home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / Jogos de Azar / pokersuperstars.swf / scripts / frame_1 / DoAction.as < prev   
Text File  |  2006-01-17  |  142KB  |  4,996 lines

  1. function initSplashScreen(logo)
  2. {
  3.    createEmptyMovieClip("snd",99);
  4.    snd.loadMovie("Sounds.swf","GET");
  5.    snd._visible = false;
  6.    snd.tabIndex = 1;
  7.    snd.onLoad();
  8.    vol = 80;
  9.    volM = 50;
  10.    this.PlaySoundEffect = function(snd)
  11.    {
  12.       _root.snd.PlaySoundEffect(snd,vol);
  13.    };
  14.    this.PlayMusic = function(snd)
  15.    {
  16.       _root.snd.PlayMusic(snd,volM);
  17.    };
  18.    this.StopMusic = function(snd)
  19.    {
  20.       _root.snd.StopMusic();
  21.    };
  22.    this.SetMusicVolume = function()
  23.    {
  24.       _root.snd.SetMusicVolume(volM);
  25.    };
  26.    this.SetMusicVolume();
  27.    createEmptyMovieClip("preloader",5);
  28.    preloader.attachMovie("bkgdSplash","bkgdSplash",3);
  29.    preloader.bkgdSplash.btn_start._visible = false;
  30.    preloader.bkgdSplash.vsint._visible = false;
  31.    preloader.bkgdSplash.vs._visible = false;
  32.    if(_global.noZoneAPI == true)
  33.    {
  34.       preloader.bkgdSplash.zonelogo._visible = false;
  35.       preloader.bkgdSplash.zonelogo.gotoAndStop(1);
  36.    }
  37.    else
  38.    {
  39.       preloader.bkgdSplash.zonelogo._visible = true;
  40.       preloader.bkgdSplash.zonelogo.gotoAndStop(2);
  41.    }
  42.    preloader.bkgdSplash.btn_start.btn.onRelease = function()
  43.    {
  44.       _root.initMenu();
  45.       if(_global.noZoneAPI != true)
  46.       {
  47.          DoGameReady();
  48.       }
  49.       _root.preloader.removeMovieClip();
  50.    };
  51.    preloader.bkgdSplash.btn_start.btn.onPress = function()
  52.    {
  53.       this.PlaySoundEffect("SOUND_CLICK1");
  54.    };
  55.    preloader.createEmptyMovieClip("lgf",7);
  56.    preloader.lgf.loadMovie(logo);
  57.    preloader.lgf._x = 0 + logobufferx;
  58.    preloader.lgf._y = 0 + logobuffery;
  59.    preloader.lgf._yscale = 80;
  60.    preloader.lgf._xscale = 80;
  61. }
  62. function DoCustomEvent(event)
  63. {
  64.    trace("DOWNLOADING NOW");
  65.    if(_global.download != null)
  66.    {
  67.       if(_global.downloadtype == "blank")
  68.       {
  69.          getURL(_global.download,"_blank");
  70.       }
  71.       else
  72.       {
  73.          getURL(_global.download,"");
  74.       }
  75.       return undefined;
  76.    }
  77.    eventhardcoded = "CustomEvent";
  78.    getURL("FSCommand:CustomEvent","<gamedata>" + eventhardcoded + "</gamedata>");
  79.    if(_root.gFake)
  80.    {
  81.       DoCustomReturn(null);
  82.    }
  83. }
  84. function DoCustomReturn(customData)
  85. {
  86. }
  87. function DoGameBreak()
  88. {
  89.    zoneBreaks++;
  90.    getURL("FSCommand:GameBreak","<data><breakpoint>" + zoneBreaks + "</breakpoint></data>");
  91.    numHandsPlayed++;
  92.    if(_root.gFake)
  93.    {
  94.       DoGameContinue(null);
  95.    }
  96. }
  97. function DoGameContinue(gameBreakData)
  98. {
  99.    doLog("game continue: " + gameBreakData);
  100.    _root.getDealStandings();
  101. }
  102. function DoGameEnd()
  103. {
  104.    DoScoreSubmit(zoneScore);
  105.    getUrl("FSCommand:GameEnd", "<gamedata></gamedata>");
  106. }
  107. function DoGameError()
  108. {
  109. }
  110. function DoGameMenu()
  111. {
  112. }
  113. function DoGameReady()
  114. {
  115.    getUrl("FSCommand:GameReady", "<data><mode>round</mode><difficulty></difficulty><startlevel></startlevel></data>");
  116.    if(_root.gFake)
  117.    {
  118.       DoGameStart();
  119.    }
  120. }
  121. function DoGameStart()
  122. {
  123.    if(gamestartrun)
  124.    {
  125.       PlayMusic("MUSIC_INTRO",_root.volM);
  126.    }
  127.    gamestartrun = true;
  128.    _root.gBreakId = 1;
  129.    _root.gGameStartTime = getTimer();
  130. }
  131. function DoScoreEvent(what, myscore)
  132. {
  133.    var _loc2_ = int((getTimer() - _root.gGameStartTime) / 1000);
  134.    getURL("FSCommand:" add what,"<game><score>" + myscore + "</score><time>" + _loc2_ + "</time></game>");
  135. }
  136. function DoScoreBroadcast()
  137. {
  138.    DoScoreEvent("ScoreBroadcast",zoneScore);
  139. }
  140. function DoScoreSubmit(fscore)
  141. {
  142.    DoScoreEvent("ScoreSubmit",fscore);
  143. }
  144. function DoSessionReady()
  145. {
  146.    getUrl("FSCommand:SessionReady", "<data></data>");
  147.    if(_root.gFake)
  148.    {
  149.       DoSessionStart();
  150.    }
  151. }
  152. function DoSessionStart()
  153. {
  154.    preloader.bkgdSplash.btn_start._visible = true;
  155.    _root.PlaySoundEffect("SOUND_CHIP1");
  156.    _root.PlayMusic("MUSIC_INTRO",_root.volM);
  157. }
  158. function initLoader()
  159. {
  160.    if(!loaded)
  161.    {
  162.       loaded = true;
  163.       isGameTimerActive = false;
  164.       maxHandsAllowed = 0;
  165.       _global.logo = "";
  166.       _global.shockwave = false;
  167.       _global.noZoneAPI = true;
  168.       _global.realmode = false;
  169.       _global.download = null;
  170.       _global.downloadType = "self";
  171.       zoneBreaks = 0;
  172.       blindincrement = 4;
  173.       _root.settings.load("pokerss.xml");
  174.    }
  175.    else
  176.    {
  177.       if(_global.noZoneAPI == true)
  178.       {
  179.          initSplashScreen(_global.logo);
  180.       }
  181.       else
  182.       {
  183.          initSplashScreen(_global.logo,true);
  184.       }
  185.       initSplashScreen();
  186.    }
  187. }
  188. function setEnterNameListener()
  189. {
  190.    listenForEnter_obj = new Object();
  191.    listenForEnter_obj.onKeyDown = function()
  192.    {
  193.       if(Key.isDown(13) && this.pressedOnce == undefined)
  194.       {
  195.          if(gameMenu.active == "menu")
  196.          {
  197.             gameMenu.bkgdMenu.btn_play.btn.onRelease();
  198.          }
  199.          else if(gameMenu.active == "enterName")
  200.          {
  201.             gameMenu.bkgdEnterName.btn_okay.btn.onRelease();
  202.          }
  203.          this.pressedOnce = true;
  204.       }
  205.    };
  206.    listenForEnter_obj.onKeyUp = function()
  207.    {
  208.       this.pressedOnce = undefined;
  209.    };
  210.    Key.addListener(listenForEnter_obj);
  211. }
  212. function initMenu(defer, makenoise)
  213. {
  214.    createEmptyMovieClip("gameMenu",_root.menudepth);
  215.    gameMenu.mydepth = 0;
  216.    gameMenu.active = "menu";
  217.    gameMenu.attachMovie("bkgdMenu","bkgdMenu",gameMenu.mydepth++);
  218.    gameMenu.buttonNames = new Array("howtoplay","options","quit","play","download","round","season","cashgame");
  219.    i = 0;
  220.    while(i < gameMenu.buttonNames.length)
  221.    {
  222.       gameMenu.bkgdMenu["btn_" + gameMenu.buttonNames[i]].btn.onRelease = function()
  223.       {
  224.          if(_root.gameMenu.active == "menu")
  225.          {
  226.             _root.menuButtons(this._parent.myname.text);
  227.          }
  228.       };
  229.       gameMenu.bkgdMenu["btn_" + gameMenu.buttonNames[i]].btn.onPress = function()
  230.       {
  231.          if(_root.gameMenu.active == "menu")
  232.          {
  233.             _root.buttonSound();
  234.          }
  235.       };
  236.       i++;
  237.    }
  238.    gameMenu.bkgdMenu.btn_round.radio.gotoAndStop(2);
  239.    gameMenu.bkgdMenu.playerCard.highlite.onRelease = function()
  240.    {
  241.       if(_root.gameMenu.active == "menu")
  242.       {
  243.          getUpsell();
  244.       }
  245.    };
  246.    gameMenu.bkgdMenu.playerCard.highlite.onPress = function()
  247.    {
  248.       if(_root.gameMenu.active == "menu")
  249.       {
  250.          _root.buttonSound();
  251.       }
  252.    };
  253.    if(_global.realmode == true)
  254.    {
  255.       gameMenu.bkgdMenu.btn_download._visible = false;
  256.    }
  257.    if(_global.shockwave)
  258.    {
  259.       gameMenu.bkgdMenu.vs._visible = true;
  260.       gameMenu.bkgdMenu.vsint._visible = true;
  261.    }
  262.    else
  263.    {
  264.       gameMenu.bkgdMenu.vsint._visible = false;
  265.       gameMenu.bkgdMenu.vs._visible = false;
  266.    }
  267.    PlaySoundEffect("SOUND_CHIP1");
  268.    if(!defer)
  269.    {
  270.       getEnterName();
  271.    }
  272.    else if(makenoise != "nosound")
  273.    {
  274.       PlayMusic("MUSIC_INTRO",_root.volM);
  275.    }
  276.    setEnterNameListener();
  277. }
  278. function menuButtons(myname)
  279. {
  280.    myname = myname.toLowerCase();
  281.    switch(myname)
  282.    {
  283.       case "play":
  284.          mygame = new Game();
  285.          gameMenu.removeMovieClip();
  286.          break;
  287.       case "quit":
  288.          getUpsell("quit");
  289.          break;
  290.       case "how to play":
  291.          trace("getting help");
  292.          getHelp();
  293.          break;
  294.       case "options":
  295.          getOptions();
  296.          break;
  297.       case "round":
  298.          getUpsell();
  299.          break;
  300.       case "season":
  301.          getUpsell();
  302.          break;
  303.       case "download":
  304.          downloadAction();
  305.          break;
  306.       case "cash game":
  307.          getUpsell();
  308.    }
  309. }
  310. function getOptions()
  311. {
  312.    gameMenu.attachMovie("bkgdOptions","bkgdOptions",gameMenu.mydepth++);
  313.    gameMenu.optionNames = new Array("okay","credits","switch");
  314.    i = 0;
  315.    while(i < gameMenu.optionNames.length)
  316.    {
  317.       gameMenu.bkgdOptions["btn_" + gameMenu.optionNames[i]].btn.onRelease = function()
  318.       {
  319.          if(gameMenu.active == "options")
  320.          {
  321.             _root.optionButtons(this._parent.myname.text);
  322.          }
  323.       };
  324.       gameMenu.bkgdOptions["btn_" + gameMenu.optionNames[i]].btn.onPress = function()
  325.       {
  326.          if(gameMenu.active == "options")
  327.          {
  328.             _root.buttonSound();
  329.          }
  330.       };
  331.       i++;
  332.    }
  333.    gameMenu.bkgdOptions.gamespeed.onPress = function()
  334.    {
  335.       if(gameMenu.active == "options")
  336.       {
  337.          _root.buttonSound();
  338.          _root.optionButtons("gamespeed");
  339.       }
  340.    };
  341.    gameMenu.active = "options";
  342.    gameMenu.bkgdOptions.tSnd._x = Math.round(273 + vol / 0.623);
  343.    gameMenu.bkgdOptions.tMusic._x = Math.round(273 + volM / 0.623);
  344. }
  345. function optionButtons(myname)
  346. {
  347.    myname = myname.toLowerCase();
  348.    switch(myname)
  349.    {
  350.       case "okay":
  351.          gameMenu.active = "menu";
  352.          gameMenu.bkgdOptions.removeMovieClip();
  353.          break;
  354.       case "credits":
  355.          getCredits();
  356.          break;
  357.       case "switch":
  358.          getUpsell();
  359.          break;
  360.       case "gamespeed":
  361.          getUpsell();
  362.    }
  363. }
  364. function getCredits()
  365. {
  366.    gameMenu.attachMovie("bkgdCredits","bkgdCredits",gameMenu.mydepth++);
  367.    gameMenu.bkgdCredits.btn_okay.btn.onRelease = function()
  368.    {
  369.       if(gameMenu.active == "credits")
  370.       {
  371.          _root.gameMenu.active = "options";
  372.          _root.gameMenu.bkgdCredits.removeMovieClip();
  373.       }
  374.    };
  375.    gameMenu.bkgdCredits.btn_okay.btn.onPress = function()
  376.    {
  377.       if(gameMenu.active == "credits")
  378.       {
  379.          _root.buttonSound();
  380.       }
  381.    };
  382.    gameMenu.active = "credits";
  383. }
  384. function getUpsell(type)
  385. {
  386.    myActive = gameMenu.active;
  387.    gameMenu.attachMovie("bkgdUpsell","bkgdUpsell",gameMenu.mydepth++);
  388.    gameMenu.bkgdUpsell.btn_okay.btn.onRelease = function()
  389.    {
  390.       if(gameMenu.active == "upsell")
  391.       {
  392.          _root.gameMenu.active = _root.myActive;
  393.          _root.gameMenu.bkgdUpsell.removeMovieClip();
  394.       }
  395.    };
  396.    gameMenu.bkgdUpsell.btn_okay.btn.onPress = function()
  397.    {
  398.       if(gameMenu.active == "upsell")
  399.       {
  400.          _root.buttonSound();
  401.       }
  402.    };
  403.    gameMenu.bkgdUpsell.btn_download.btn.onRelease = function()
  404.    {
  405.       if(gameMenu.active == "upsell")
  406.       {
  407.          _root.downloadAction();
  408.       }
  409.    };
  410.    gameMenu.bkgdUpsell.btn_download.btn.onPress = function()
  411.    {
  412.       if(gameMenu.active == "upsell")
  413.       {
  414.          _root.buttonSound();
  415.       }
  416.    };
  417.    if(_global.realmode == true)
  418.    {
  419.       gameMenu.bkgdUpsell.btn_download._visible = false;
  420.       gameMenu.bkgdUpsell.btn_okay._x += 60;
  421.    }
  422.    gameMenu.active = "upsell";
  423. }
  424. function getEnterName(type)
  425. {
  426.    gameMenu.attachMovie("bkgdEnterName","bkgdEnterName",gameMenu.mydepth++);
  427.    if(_root.username)
  428.    {
  429.       gameMenu.bkgdEnterName.username.text = _root.username;
  430.    }
  431.    gameMenu.bkgdEnterName.btn_okay.btn.onRelease = function()
  432.    {
  433.       if(gameMenu.active == "enterName")
  434.       {
  435.          if(this._parent._parent.username.text == "" || this._parent._parent.username.text == undefined)
  436.          {
  437.             _root.setName("Player");
  438.          }
  439.          else
  440.          {
  441.             _root.setName(this._parent._parent.username.text);
  442.          }
  443.          _root.gameMenu.active = "menu";
  444.          _root.gameMenu.bkgdEnterName.removeMovieClip();
  445.       }
  446.    };
  447.    gameMenu.bkgdEnterName.btn_okay.btn.onPress = function()
  448.    {
  449.       if(gameMenu.active == "enterName")
  450.       {
  451.          _root.buttonSound();
  452.       }
  453.    };
  454.    gameMenu.bkgdEnterName.btn_cancel.btn.onRelease = function()
  455.    {
  456.       if(gameMenu.active == "enterName")
  457.       {
  458.          if(this._parent._parent.username.text == "" || this._parent._parent.username.text == undefined)
  459.          {
  460.             _root.setName("Player");
  461.          }
  462.          _root.gameMenu.active = "menu";
  463.          _root.gameMenu.bkgdEnterName.removeMovieClip();
  464.       }
  465.    };
  466.    gameMenu.bkgdEnterName.btn_cancel.btn.onPress = function()
  467.    {
  468.       if(gameMenu.active == "enterName")
  469.       {
  470.          _root.buttonSound();
  471.       }
  472.    };
  473.    gameMenu.active = "enterName";
  474. }
  475. function getHelp()
  476. {
  477.    loadMovieNum("howtoplay.swf",23,"GET");
  478. }
  479. function getTableHelp()
  480. {
  481.    loadMovieNum("howtoplay.swf",23,"GET");
  482. }
  483. function setName(name)
  484. {
  485.    _root.username = name;
  486.    if(_root.username)
  487.    {
  488.       gameMenu.bkgdMenu.playerCard.username.text = _root.username;
  489.    }
  490. }
  491. function buttonSound()
  492. {
  493.    _root.PlaySoundEffect("SOUND_CLICK1");
  494. }
  495. function initTableMenu()
  496. {
  497.    createEmptyMovieClip("tableMenu",_root.tablemenudepth);
  498.    tableMenu.mydepth = 0;
  499.    tableMenu.attachMovie("btn_pause","btn_pause",tableMenu.mydepth++);
  500.    tableMenu.btn_pause._x = 529;
  501.    tableMenu.btn_pause._y = 275.5;
  502.    if(_global.noZoneAPI == true)
  503.    {
  504.       tableMenu.btn_pause._visible = false;
  505.    }
  506.    tableMenu.attachMovie("btn_help","btn_help",tableMenu.mydepth++);
  507.    tableMenu.btn_help._x = 529;
  508.    tableMenu.btn_help._y = 350.5;
  509.    tableMenu.attachMovie("btn_options","btn_options",tableMenu.mydepth++);
  510.    tableMenu.btn_options._x = 529;
  511.    tableMenu.btn_options._y = 325.5;
  512.    tableMenu.attachMovie("btn_download","btn_download",tableMenu.mydepth++);
  513.    tableMenu.btn_download._x = 529;
  514.    tableMenu.btn_download._y = 300.5;
  515.    if(_global.realmode == true)
  516.    {
  517.       tableMenu.btn_download._visible = false;
  518.    }
  519.    tableMenu.attachMovie("btn_quit","btn_quit",tableMenu.mydepth++);
  520.    tableMenu.btn_quit._x = 529;
  521.    tableMenu.btn_quit._y = 375.5;
  522.    tableMenu.active = "menu";
  523.    tableMenu.buttonNames = new Array("options","help","download","quit","pause");
  524.    i = 0;
  525.    while(i < tableMenu.buttonNames.length)
  526.    {
  527.       tableMenu["btn_" + tableMenu.buttonNames[i]].btn.onRelease = function()
  528.       {
  529.          if(_root.tableMenu.active == "menu")
  530.          {
  531.             _root.tableMenuButtons(this._parent.myname.text);
  532.          }
  533.       };
  534.       tableMenu["btn_" + tableMenu.buttonNames[i]].btn.onPress = function()
  535.       {
  536.          if(_root.tableMenu.active == "menu")
  537.          {
  538.             _root.buttonSound();
  539.          }
  540.       };
  541.       i++;
  542.    }
  543. }
  544. function tableMenuButtons(myname)
  545. {
  546.    myname = myname.toLowerCase();
  547.    switch(myname)
  548.    {
  549.       case "help":
  550.          getTableHelp();
  551.          break;
  552.       case "pause":
  553.          gamePause();
  554.          break;
  555.       case "get tip":
  556.          getTableUpsell("quit");
  557.          break;
  558.       case "options":
  559.          getTableOptions();
  560.          break;
  561.       case "download":
  562.          _root.downloadAction();
  563.          break;
  564.       case "quit":
  565.          getTableQuit();
  566.    }
  567. }
  568. function getTableQuit()
  569. {
  570.    tableMenu.attachMovie("bkgdQuit","bkgdQuit",tableMenu.mydepth++);
  571.    tableMenu.bkgdQuit.btn_yes.btn.onRelease = function()
  572.    {
  573.       if(tableMenu.active == "quit")
  574.       {
  575.          killTheGame("defer");
  576.       }
  577.    };
  578.    tableMenu.bkgdQuit.btn_no.btn.onRelease = function()
  579.    {
  580.       if(tableMenu.active == "quit")
  581.       {
  582.          tableMenu.active = "menu";
  583.          tableMenu.bkgdQuit.removeMovieClip();
  584.       }
  585.    };
  586.    tableMenu.bkgdQuit.btn_yes.btn.onPress = function()
  587.    {
  588.       if(tableMenu.active == "quit")
  589.       {
  590.          _root.buttonSound();
  591.       }
  592.    };
  593.    tableMenu.bkgdQuit.btn_no.btn.onPress = function()
  594.    {
  595.       if(tableMenu.active == "quit")
  596.       {
  597.          _root.buttonSound();
  598.       }
  599.    };
  600.    tableMenu.active = "quit";
  601. }
  602. function getTableOptions()
  603. {
  604.    tableMenu.attachMovie("bkgdOptions","bkgdOptions",tableMenu.mydepth++);
  605.    tableMenu.optionNames = new Array("okay","credits","switch");
  606.    i = 0;
  607.    while(i < tableMenu.optionNames.length)
  608.    {
  609.       tableMenu.bkgdOptions["btn_" + tableMenu.optionNames[i]].btn.onRelease = function()
  610.       {
  611.          trace("this._parent.myname.text");
  612.          if(tableMenu.active == "options")
  613.          {
  614.             _root.tableOptionButtons(this._parent.myname.text);
  615.          }
  616.       };
  617.       tableMenu.bkgdOptions["btn_" + tableMenu.optionNames[i]].btn.onPress = function()
  618.       {
  619.          if(tableMenu.active == "options")
  620.          {
  621.             _root.buttonSound();
  622.          }
  623.       };
  624.       i++;
  625.    }
  626.    tableMenu.bkgdOptions.gamespeed.onPress = function()
  627.    {
  628.       if(tableMenu.active == "options")
  629.       {
  630.          _root.buttonSound();
  631.          _root.tableOptionButtons("gamespeed");
  632.       }
  633.    };
  634.    tableMenu.active = "options";
  635.    tableMenu.bkgdOptions.tSnd._x = Math.round(273 + vol / 0.623);
  636.    tableMenu.bkgdOptions.tMusic._x = Math.round(273 + volM / 0.623);
  637. }
  638. function tableOptionButtons(myname)
  639. {
  640.    myname = myname.toLowerCase();
  641.    switch(myname)
  642.    {
  643.       case "okay":
  644.          tableMenu.active = "menu";
  645.          tableMenu.bkgdOptions.removeMovieClip();
  646.          break;
  647.       case "credits":
  648.          getTableCredits();
  649.          break;
  650.       case "switch":
  651.          getTableUpsell();
  652.          break;
  653.       case "gamespeed":
  654.          getTableUpsell();
  655.    }
  656. }
  657. function getTableCredits()
  658. {
  659.    tableMenu.attachMovie("bkgdCredits","bkgdCredits",tableMenu.mydepth++);
  660.    tableMenu.bkgdCredits.btn_okay.btn.onRelease = function()
  661.    {
  662.       if(tableMenu.active == "credits")
  663.       {
  664.          _root.tableMenu.active = "options";
  665.          _root.tableMenu.bkgdCredits.removeMovieClip();
  666.       }
  667.    };
  668.    tableMenu.bkgdCredits.btn_okay.btn.onPress = function()
  669.    {
  670.       if(tableMenu.active == "credits")
  671.       {
  672.          _root.buttonSound();
  673.       }
  674.    };
  675.    tableMenu.active = "credits";
  676. }
  677. function getTableUpsell(type)
  678. {
  679.    myActive = tableMenu.active;
  680.    tableMenu.attachMovie("bkgdUpsell","bkgdUpsell",tableMenu.mydepth++);
  681.    tableMenu.bkgdUpsell.btn_okay.btn.onRelease = function()
  682.    {
  683.       if(tableMenu.active == "upsell")
  684.       {
  685.          _root.tableMenu.active = _root.myActive;
  686.          _root.tableMenu.bkgdUpsell.removeMovieClip();
  687.       }
  688.    };
  689.    tableMenu.bkgdUpsell.btn_okay.btn.onPress = function()
  690.    {
  691.       if(tableMenu.active == "upsell")
  692.       {
  693.          _root.buttonSound();
  694.       }
  695.    };
  696.    tableMenu.bkgdUpsell.btn_download.btn.onRelease = function()
  697.    {
  698.       if(tableMenu.active == "upsell")
  699.       {
  700.          _root.downloadAction();
  701.       }
  702.    };
  703.    if(_global.realmode == true)
  704.    {
  705.       tableMenu.bkgdUpsell.btn_download._visible = false;
  706.       tableMenu.bkgdUpsell.btn_okay._x = 260;
  707.    }
  708.    tableMenu.bkgdUpsell.btn_download.btn.onPress = function()
  709.    {
  710.       if(tableMenu.active == "upsell")
  711.       {
  712.          _root.buttonSound();
  713.       }
  714.    };
  715.    tableMenu.active = "upsell";
  716. }
  717. function downloadAction()
  718. {
  719.    trace("GOT TO DOWNLOAD BUTTON");
  720.    _root.DoCustomEvent("download");
  721. }
  722. function Bubble()
  723. {
  724.    createEmptyMovieClip("bubbles",_root.bubbledepth);
  725.    this.mydepth = 0;
  726. }
  727. function processHand(who)
  728. {
  729.    var _loc6_ = undefined;
  730.    _loc6_ = 0;
  731.    while(_loc6_ < 8)
  732.    {
  733.       this["x" + _loc6_] = null;
  734.       _loc6_ = _loc6_ + 1;
  735.    }
  736.    this["bestHand" + who] = new Array();
  737.    cAr = new Array();
  738.    x1 = arena["card_" + who + "_0"].mycard;
  739.    x2 = arena["card_" + who + "_1"].mycard;
  740.    _loc6_ = 0;
  741.    while(_loc6_ < 5)
  742.    {
  743.       this["x" + (_loc6_ + 3)] = arena["card_comm_" + _loc6_].mycard;
  744.       _loc6_ = _loc6_ + 1;
  745.    }
  746.    if(x3 == null || x3 == undefined)
  747.    {
  748.       hh1 = x1;
  749.       hh2 = x2;
  750.       divider = 0;
  751.       _loc6_ = 1;
  752.       while(_loc6_ < 3)
  753.       {
  754.          if(this["hh" + _loc6_] > 13 && this["hh" + _loc6_] < 27)
  755.          {
  756.             divider = 13;
  757.          }
  758.          else if(this["hh" + _loc6_] > 26 && this["hh" + _loc6_] < 40)
  759.          {
  760.             divider = 26;
  761.          }
  762.          else if(this["hh" + _loc6_] > 39)
  763.          {
  764.             divider = 39;
  765.          }
  766.          this["hh" + _loc6_] -= divider;
  767.          _loc6_ = _loc6_ + 1;
  768.       }
  769.       if(hh1 == 1)
  770.       {
  771.          hh1 = 14;
  772.       }
  773.       if(hh2 == 1)
  774.       {
  775.          hh2 = 14;
  776.       }
  777.       if(hh1 == hh2)
  778.       {
  779.          playerHand = 1;
  780.          thisPair0 = hh1;
  781.       }
  782.       else
  783.       {
  784.          playerHand = 0;
  785.       }
  786.       bestHand = new Array();
  787.       bestHand.push(playerHand);
  788.       hc = hh1;
  789.       if(playerHand == 0)
  790.       {
  791.          if(hh1 > hh2)
  792.          {
  793.             bestHand.push(hh1);
  794.             bestHand.push(hh2);
  795.          }
  796.          else
  797.          {
  798.             bestHand.push(hh2);
  799.             bestHand.push(hh1);
  800.             hc = hh2;
  801.          }
  802.          bestHand.push(0);
  803.          bestHand.push(0);
  804.          bestHand.push(0);
  805.          dval = getVal(bestHand[1]);
  806.          handText = "HIGH CARD - " + dval;
  807.       }
  808.       if(playerHand == 1 || playerhand == 0 && pairNum0 > 0)
  809.       {
  810.          bestHand.push(thisPair0);
  811.          bestHand.push(0);
  812.          bestHand.push(0);
  813.          bestHand.push(0);
  814.          bestHand.push(0);
  815.          dval = getVal(bestHand[1]);
  816.          handText = "Pair of  " + dval + "\'s";
  817.          hc = hh1;
  818.       }
  819.       aString = "";
  820.       gg = 0;
  821.       while(gg < bestHand.length)
  822.       {
  823.          if(bestHand[gg].toString().substring(0,2).length == 1 && gg > 0)
  824.          {
  825.             aString += "0" + bestHand[gg];
  826.          }
  827.          else
  828.          {
  829.             aString += bestHand[gg].toString();
  830.          }
  831.          gg++;
  832.       }
  833.       aNumber = Number(aString);
  834.       pos = new Array();
  835.       if(hc == hh1)
  836.       {
  837.          pos.push({loc:0,card:hh1});
  838.          pos.push({loc:1,card:hh2});
  839.       }
  840.       else
  841.       {
  842.          pos.push({loc:1,card:hh2});
  843.          pos.push({loc:0,card:hh1});
  844.       }
  845.       this["bestHand" + who].push({h:bestHand,t:handText,a:aNumber,p:pos,hc:hc,pair0:thisPair0,pair1:0});
  846.       trace("--besthand  " + bestHand);
  847.       trace("--handtext  " + handText);
  848.       trace("--anumber  " + aNumber);
  849.    }
  850.    else
  851.    {
  852.       _loc6_ = 0;
  853.       while(_loc6_ < 8)
  854.       {
  855.          if(this["x" + _loc6_] != undefined && this["x" + _loc6_] != null)
  856.          {
  857.             cAr.push(this["x" + _loc6_]);
  858.          }
  859.          _loc6_ = _loc6_ + 1;
  860.       }
  861.       var aString = "";
  862.       var gg = 0;
  863.       var _loc17_ = 0;
  864.       var _loc7_ = 0;
  865.       var _loc5_ = 0;
  866.       var _loc4_ = 0;
  867.       var _loc2_ = 0;
  868.       var _loc3_ = 0;
  869.       _loc7_ = 0;
  870.       while(_loc7_ < cAr.length - 4)
  871.       {
  872.          _loc5_ = _loc7_ + 1;
  873.          while(_loc5_ < cAr.length - 3)
  874.          {
  875.             _loc4_ = _loc5_ + 1;
  876.             while(_loc4_ < cAr.length - 2)
  877.             {
  878.                _loc2_ = _loc4_ + 1;
  879.                while(_loc2_ < cAr.length - 1)
  880.                {
  881.                   _loc3_ = _loc2_ + 1;
  882.                   while(_loc3_ < cAr.length)
  883.                   {
  884.                      hAr = new Array(cAr[_loc7_],cAr[_loc5_],cAr[_loc4_],cAr[_loc2_],cAr[_loc3_]);
  885.                      scoreHand(hAr);
  886.                      aString = "";
  887.                      gg = 0;
  888.                      while(gg < bestHand.length)
  889.                      {
  890.                         if(bestHand[gg].toString().substring(0,2).length == 1 && gg > 0)
  891.                         {
  892.                            aString += "0" + bestHand[gg];
  893.                         }
  894.                         else
  895.                         {
  896.                            aString += bestHand[gg].toString();
  897.                         }
  898.                         gg++;
  899.                      }
  900.                      if(aString.substring(0,1) == 0)
  901.                      {
  902.                         aString = aString.substring(1,aString.length);
  903.                      }
  904.                      aNumber = Number(aString);
  905.                      pos = new Array();
  906.                      pos.push({loc:_loc7_,card:cAr[_loc7_]});
  907.                      pos.push({loc:_loc5_,card:cAr[_loc5_]});
  908.                      pos.push({loc:_loc4_,card:cAr[_loc4_]});
  909.                      pos.push({loc:_loc2_,card:cAr[_loc2_]});
  910.                      pos.push({loc:_loc3_,card:cAr[_loc3_]});
  911.                      this["bestHand" + who].push({h:bestHand,t:handText,a:aNumber,p:pos,hc:hc,pair0:thisPair0,pair1:thisPair1});
  912.                      _loc17_ = _loc17_ + 1;
  913.                      _loc3_ = _loc3_ + 1;
  914.                   }
  915.                   _loc2_ = _loc2_ + 1;
  916.                }
  917.                _loc4_ = _loc4_ + 1;
  918.             }
  919.             _loc5_ = _loc5_ + 1;
  920.          }
  921.          _loc7_ = _loc7_ + 1;
  922.       }
  923.       this["bestHand" + who].sortOn("a",18);
  924.       trace("-----FINAL HAND " + who + " -----");
  925.       trace("h - " + this["bestHand" + who][0].h);
  926.       trace("a - " + this["bestHand" + who][0].a);
  927.       trace("");
  928.    }
  929. }
  930. function highlightWinningCards(who, where)
  931. {
  932.    var _loc2_ = undefined;
  933.    if(!who)
  934.    {
  935.       who = 0;
  936.    }
  937.    var _loc3_ = new Array();
  938.    var _loc5_ = new Array();
  939.    var _loc10_ = _root["bestHand" + who][0].h[0];
  940.    var _loc6_ = _root["bestHand" + who][0].hc;
  941.    var _loc8_ = _root["bestHand" + who][0].pair0;
  942.    var _loc9_ = _root["bestHand" + who][0].pair1;
  943.    var _loc4_ = _root["bestHand" + who][0].p;
  944.    if(_loc10_ == 0)
  945.    {
  946.       _loc2_ = 0;
  947.       while(_loc2_ < _loc4_.length)
  948.       {
  949.          tmpcard = getDivider(_loc4_[_loc2_].card);
  950.          tmploc = _loc4_[_loc2_].loc;
  951.          if(tmpcard == _loc6_)
  952.          {
  953.             _loc3_.push(tmploc);
  954.             break;
  955.          }
  956.          _loc2_ = _loc2_ + 1;
  957.       }
  958.    }
  959.    if(_loc10_ == 1)
  960.    {
  961.       _loc2_ = 0;
  962.       while(_loc2_ < _loc4_.length)
  963.       {
  964.          tmpcard = getDivider(_loc4_[_loc2_].card);
  965.          tmploc = _loc4_[_loc2_].loc;
  966.          if(tmpcard == _loc8_)
  967.          {
  968.             _loc3_.push(tmploc);
  969.          }
  970.          if(tmpcard == _loc6_)
  971.          {
  972.             _loc5_.push(tmploc);
  973.          }
  974.          _loc2_ = _loc2_ + 1;
  975.       }
  976.    }
  977.    if(_loc10_ == 2)
  978.    {
  979.       _loc2_ = 0;
  980.       while(_loc2_ < _loc4_.length)
  981.       {
  982.          tmpcard = getDivider(_loc4_[_loc2_].card);
  983.          tmploc = _loc4_[_loc2_].loc;
  984.          if(tmpcard == _loc8_ || tmpcard == _loc9_)
  985.          {
  986.             _loc3_.push(tmploc);
  987.          }
  988.          if(tmpcard == _loc6_)
  989.          {
  990.             _loc5_.push(tmploc);
  991.          }
  992.          _loc2_ = _loc2_ + 1;
  993.       }
  994.    }
  995.    if(_loc10_ == 3)
  996.    {
  997.       _loc2_ = 0;
  998.       while(_loc2_ < _loc4_.length)
  999.       {
  1000.          tmpcard = getDivider(_loc4_[_loc2_].card);
  1001.          tmploc = _loc4_[_loc2_].loc;
  1002.          if(tmpcard == _loc8_)
  1003.          {
  1004.             _loc3_.push(tmploc);
  1005.          }
  1006.          if(tmpcard == _loc6_)
  1007.          {
  1008.             _loc5_.push(tmploc);
  1009.          }
  1010.          _loc2_ = _loc2_ + 1;
  1011.       }
  1012.    }
  1013.    if(_loc10_ == 6)
  1014.    {
  1015.       _loc2_ = 0;
  1016.       while(_loc2_ < _loc4_.length)
  1017.       {
  1018.          tmpcard = getDivider(_loc4_[_loc2_].card);
  1019.          tmploc = _loc4_[_loc2_].loc;
  1020.          if(tmpcard == _loc8_ || tmpcard == _loc9_)
  1021.          {
  1022.             _loc3_.push(tmploc);
  1023.          }
  1024.          if(tmpcard == _loc6_)
  1025.          {
  1026.             _loc5_.push(tmploc);
  1027.          }
  1028.          _loc2_ = _loc2_ + 1;
  1029.       }
  1030.    }
  1031.    if(_loc10_ == 7)
  1032.    {
  1033.       _loc2_ = 0;
  1034.       while(_loc2_ < _loc4_.length)
  1035.       {
  1036.          tmpcard = getDivider(_loc4_[_loc2_].card);
  1037.          tmploc = _loc4_[_loc2_].loc;
  1038.          if(tmpcard == _loc8_)
  1039.          {
  1040.             _loc3_.push(tmploc);
  1041.          }
  1042.          if(tmpcard == _loc6_)
  1043.          {
  1044.             _loc5_.push(tmploc);
  1045.          }
  1046.          _loc2_ = _loc2_ + 1;
  1047.       }
  1048.    }
  1049.    if(_loc10_ == 4 || _loc10_ == 5 || _loc10_ == 8 || _loc10_ == 9)
  1050.    {
  1051.       _loc2_ = 0;
  1052.       while(_loc2_ < _loc4_.length)
  1053.       {
  1054.          tmploc = _loc4_[_loc2_].loc;
  1055.          _loc3_.push(tmploc);
  1056.          _loc2_ = _loc2_ + 1;
  1057.       }
  1058.    }
  1059.    k = 0;
  1060.    while(k < mygame.myhand.handPlayers.length)
  1061.    {
  1062.       _loc2_ = 0;
  1063.       while(_loc2_ < 3)
  1064.       {
  1065.          arena["card_" + mygame.myhand.handPlayers[k] + "_" + _loc2_].cardback._visible = true;
  1066.          arena["card_" + mygame.myhand.handPlayers[k] + "_" + _loc2_].cardback.gotoAndStop(4);
  1067.          _loc2_ = _loc2_ + 1;
  1068.       }
  1069.       k++;
  1070.    }
  1071.    if(!where)
  1072.    {
  1073.       if(_loc5_[0] == 0 || _loc5_[0] == 1)
  1074.       {
  1075.          arena["card_" + who + "_" + _loc5_[0]].cardback.gotoAndStop(3);
  1076.       }
  1077.       else
  1078.       {
  1079.          arena["card_comm_" + (_loc5_[0] - 2)].cardback.gotoAndStop(3);
  1080.       }
  1081.       _loc2_ = 0;
  1082.       while(_loc2_ < _loc3_.length)
  1083.       {
  1084.          if(_loc3_[_loc2_] == 0 || _loc3_[_loc2_] == 1)
  1085.          {
  1086.             arena["card_" + who + "_" + _loc3_[_loc2_]].cardback._visible = true;
  1087.             arena["card_" + who + "_" + _loc3_[_loc2_]].cardback.gotoAndStop(2);
  1088.          }
  1089.          else
  1090.          {
  1091.             arena["card_comm_" + (_loc3_[_loc2_] - 2)].cardback._visible = true;
  1092.             arena["card_comm_" + (_loc3_[_loc2_] - 2)].cardback.gotoAndStop(2);
  1093.          }
  1094.          _loc2_ = _loc2_ + 1;
  1095.       }
  1096.    }
  1097.    else
  1098.    {
  1099.       if(_loc5_[0] == 0 || _loc5_[0] == 1)
  1100.       {
  1101.          allin["card_" + who + "_" + _loc5_[0]].cardback.gotoAndStop(3);
  1102.       }
  1103.       else
  1104.       {
  1105.          allin["card_comm_" + (_loc5_[0] - 2)].cardback.gotoAndStop(3);
  1106.       }
  1107.       _loc2_ = 0;
  1108.       while(_loc2_ < _loc3_.length)
  1109.       {
  1110.          if(_loc3_[_loc2_] == 0 || _loc3_[_loc2_] == 1)
  1111.          {
  1112.             allin["card_" + who + "_" + _loc3_[_loc2_]].cardback._visible = true;
  1113.             allin["card_" + who + "_" + _loc3_[_loc2_]].cardback.gotoAndStop(2);
  1114.          }
  1115.          else
  1116.          {
  1117.             allin["card_comm_" + (_loc3_[_loc2_] - 2)].cardback._visible = true;
  1118.             allin["card_comm_" + (_loc3_[_loc2_] - 2)].cardback.gotoAndStop(2);
  1119.          }
  1120.          _loc2_ = _loc2_ + 1;
  1121.       }
  1122.    }
  1123. }
  1124. function getDivider(c)
  1125. {
  1126.    divider = 0;
  1127.    if(c > 13 && c < 27)
  1128.    {
  1129.       divider = 13;
  1130.    }
  1131.    else if(c > 26 && c < 40)
  1132.    {
  1133.       divider = 26;
  1134.    }
  1135.    else if(c > 39)
  1136.    {
  1137.       divider = 39;
  1138.    }
  1139.    c -= divider;
  1140.    if(c == 1)
  1141.    {
  1142.       c = 14;
  1143.    }
  1144.    return c;
  1145. }
  1146. function shockMe(type, gamescore)
  1147. {
  1148.    myshock = new ShockwaveHubDialog(type,gamescore);
  1149.    myshock.Init();
  1150. }
  1151. function ShockwaveHubDialog(type, gamescore)
  1152. {
  1153.    this.fName = "ShockwaveHubDialog";
  1154.    this.fDefaultButton = null;
  1155.    this.fObj = obj;
  1156.    this.fCallback = callback;
  1157.    this.fInterval = null;
  1158.    this.fbDidUnload = false;
  1159.    this.fStart = getTimer();
  1160.    var _loc2_ = new Object();
  1161.    _loc2_.showTab = type;
  1162.    _loc2_.gameId = "pokersuperstarsweb";
  1163.    _loc2_.gameTitle = "Poker Superstars Single Round";
  1164.    _loc2_.screenWidth = 600;
  1165.    _loc2_.screenHeight = 400;
  1166.    _loc2_.scoreDescriptor = "Power Rank";
  1167.    _loc2_.numPlayers = 1;
  1168.    _loc2_.player1Score = gamescore;
  1169.    _loc2_.player2Score = 0;
  1170.    _loc2_.player3Score = 0;
  1171.    _loc2_.player4Score = 0;
  1172.    _level0.swHighScoreObject = _loc2_;
  1173.    _level0.playAgain = function()
  1174.    {
  1175.       arena.standings.sscover.gotoAndStop(2);
  1176.       arena.standings.powerranking = 0;
  1177.    };
  1178.    System.security.allowDomain("gameblast.shockwave.com","www.shockwave.com","dev.shockwave.com","staging.shockwave.com");
  1179. }
  1180. function gamePause()
  1181. {
  1182.    if(pauseOn == false && _global.noZoneAPI == false)
  1183.    {
  1184.       pauseOn = true;
  1185.       voltemp = vol;
  1186.       vol = 0;
  1187.       snd.onMute(true);
  1188.       createEmptyMovieClip("stopGo",_root.pausedepth);
  1189.       stopGo.attachMovie("bkgdPause","bkgdPause",2);
  1190.       stopGo.bkgdPause.btn_resume.btn.onRelease = function()
  1191.       {
  1192.          gamePauseOff();
  1193.       };
  1194.       stopGo.bkgdPause.btn_resume.btn.onPress = function()
  1195.       {
  1196.          _root.buttonSound();
  1197.       };
  1198.       baseTime = getTimer();
  1199.       pauseInterval = setInterval(calcZoneTime,100);
  1200.    }
  1201. }
  1202. function gamePauseOff()
  1203. {
  1204.    if(pauseOn == true)
  1205.    {
  1206.       pauseOn = false;
  1207.       vol = voltemp;
  1208.       snd.onMute(false);
  1209.       gGameStartTime += newtime;
  1210.       clearInterval(pauseInterval);
  1211.       if(pauseReturnAction != "" && pauseReturnAction != undefined)
  1212.       {
  1213.          mygame.myhand[pauseReturnAction]();
  1214.       }
  1215.       pauseReturnAction = "";
  1216.       stopGo.removeMovieClip();
  1217.    }
  1218. }
  1219. function calcZoneTime()
  1220. {
  1221.    newtime = getTimer() - baseTime;
  1222. }
  1223. function loadAI()
  1224. {
  1225.    loadMovieNum("AIapp_final.swf",22,"GET");
  1226. }
  1227. function unloadAI()
  1228. {
  1229.    unloadMovieNum(22);
  1230. }
  1231. function getBetLevel()
  1232. {
  1233.    ante = prePay[betLevel][2];
  1234.    bigblind = prePay[betLevel][0];
  1235.    smallblind = prePay[betLevel][1];
  1236.    minRaise = bigblind;
  1237.    mygame.ante = ante;
  1238.    mygame.smallblind = smallblind;
  1239.    mygame.bigblind = bigblind;
  1240. }
  1241. function Game()
  1242. {
  1243.    if(isGameTimerActive == true)
  1244.    {
  1245.       gameStartTime = getTimer();
  1246.    }
  1247.    Key.removeListener(listenForEnter_obj);
  1248.    botsDoAll = false;
  1249.    betLevel = 0;
  1250.    getBetLevel();
  1251.    this.ante = _root.ante;
  1252.    this.bigblind = _root.bigblind;
  1253.    this.smallblind = _root.smallblind;
  1254.    this.mybubble = new Bubble();
  1255.    this.mydepth = 0;
  1256.    this.defaultBalance = 100000;
  1257.    this.isNew = true;
  1258.    numHandsPlayedX = 0;
  1259.    numHandsPlayed = 0;
  1260.    nhrecord = 0;
  1261.    trace("TIMER ON?  " + isGameTimerActive);
  1262.    this.finalrank = new Array("4th Place","3rd Place","2nd Place","Winner");
  1263.    createEmptyMovieClip("table",_root.tabledepth);
  1264.    table.attachMovie("bkgdTable","bkgdTable",this.mydepth++);
  1265.    initTableMenu();
  1266.    this.elimPlayers = new Array();
  1267.    this.currentPlayers = new Array(0,1,2,3,4);
  1268.    if(maxplayers < 5)
  1269.    {
  1270.       this.currentPlayers[2] = "e";
  1271.    }
  1272.    t = new Array(0,1,2,4,5,6,7,8);
  1273.    t.shuffle();
  1274.    this.gPlayers = new Object();
  1275.    this.gPlayers.player3 = {first:_root.username,last:"",lTag:"THE FUTURE OF POKER?"};
  1276.    this.gPlayers["player" + t[0]] = {first:"Barry",last:"Greenstein",lTag:"MOST SUCCESSFUL CASH PLAYER OF DECADE"};
  1277.    this.gPlayers["player" + t[1]] = {first:"Chip",last:"Reese",lTag:"YOUNGEST INDUCTEE POKER HALL OF FAME"};
  1278.    this.gPlayers["player" + t[2]] = {first:"Doyle",last:"Brunson",lTag:"NINE W.S.O.P TITLES"};
  1279.    this.gPlayers["player" + t[3]] = {first:"Gus",last:"Hansen",lTag:"3 MAJOR TOURNAMENT WINS IN 10 MONTHS"};
  1280.    this.gPlayers["player" + t[4]] = {first:"Howard",last:"Lederer",lTag:"2 MAJOR TOURNAMENT WINS 2004"};
  1281.    this.gPlayers["player" + t[5]] = {first:"Johnny",last:"Chan",lTag:"BACK TO BACK WORLD CHAMPIONSHIPS"};
  1282.    this.gPlayers["player" + t[6]] = {first:"Phil",last:"Ivey",lTag:"3 W.S.O.P TITLES IN 2002"};
  1283.    this.gPlayers["player" + t[7]] = {first:"TJ",last:"Cloutier",lTag:"MOST MAJOR TOURNAMENT WINS EVER"};
  1284.    this.gPbox = new Object();
  1285.    if(maxplayers == 5)
  1286.    {
  1287.       this.gPbox.b0 = {x:-6.7,y:-7.3,chipx:4,chipy:113,dbx:102,dby:7.2,cx:99,cy:46,bsx:128.3,bsy:94,blx:128.3,bly:83};
  1288.       this.gPbox.b1 = {x:431.8,y:-4.3,chipx:350.3,chipy:7.2,dbx:536,dby:29,cx:377,cy:84,bsx:296.6,bsy:37.5,blx:286.6,bly:26.6};
  1289.       this.gPbox.b2 = {x:493,y:121.8,chipx:505.6,chipy:238.4,dbx:567,dby:93,cx:440,cy:142,bsx:483.7,bsy:92.9,blx:473.7,bly:81.9};
  1290.       this.gPbox.b3 = {x:384.8,y:282.4,chipx:393,chipy:218.2,dbx:490,dby:353,cx:330,cy:290,bsx:0,bsy:0,blx:442.4,bly:169};
  1291.       this.gPbox.b4 = {x:3.4,y:283.4,chipx:14,chipy:220,dbx:109,dby:356,cx:107,cy:279,bsx:0,bsy:0,blx:0,bly:0};
  1292.    }
  1293.    else
  1294.    {
  1295.       this.gPbox.b0 = {x:11.4,y:-5.8,chipx:22,chipy:113,dbx:116,dby:94,cx:117,cy:21,bsx:-2.7,bsy:101,blx:-12.7,bly:101};
  1296.       this.gPbox.b1 = {x:475.8,y:-5.8,chipx:489,chipy:113,dbx:448,dby:94,cx:421,cy:21,bsx:461,bsy:101,blx:451,bly:101};
  1297.       this.gPbox.b2 = {x:493,y:121.8,chipx:505.6,chipy:238.4,dbx:567,dby:93,cx:440,cy:142,bsx:483.7,bsy:92.9,blx:473.7,bly:81.9};
  1298.       this.gPbox.b3 = {x:434.8,y:283.4,chipx:443,chipy:220,dbx:406,dby:273.6,cx:380,cy:310,bsx:420,bsy:230,blx:410,bly:210};
  1299.       this.gPbox.b4 = {x:11.4,y:283.4,chipx:22,chipy:220,dbx:116,dby:273.6,cx:117,cy:310,bsx:-2.7,bsy:230,blx:-12.7,bly:210};
  1300.    }
  1301.    this.gChip = new Object();
  1302.    this.gChip.inc = 1;
  1303.    this.gChip.oflow = 15;
  1304.    this.gChip.defaultChips = {c100:10,c500:10,c1000:24,c5000:14,c25000:0};
  1305.    this.gChip.chip0 = {x:0,y:0};
  1306.    this.gChip.chip1 = {x:30,y:0};
  1307.    this.gChip.chip2 = {x:60,y:0};
  1308.    this.gChip.chip3 = {x:0,y:28};
  1309.    this.gChip.chip4 = {x:30,y:28};
  1310.    this.gChip.chip5 = {x:60,y:28};
  1311.    var _loc3_ = 0;
  1312.    while(_loc3_ < 5)
  1313.    {
  1314.       this.gChip["chip" + _loc3_].c100 = 10;
  1315.       this.gChip["chip" + _loc3_].c500 = 10;
  1316.       this.gChip["chip" + _loc3_].c1000 = 24;
  1317.       this.gChip["chip" + _loc3_].c5000 = 14;
  1318.       this.gChip["chip" + _loc3_].c25000 = 0;
  1319.       _loc3_ = _loc3_ + 1;
  1320.    }
  1321.    this.gChip.chipD = {x:226,y:93};
  1322.    this.gChip.chipD.c100 = 0;
  1323.    this.gChip.chipD.c500 = 0;
  1324.    this.gChip.chipD.c1000 = 0;
  1325.    this.gChip.chipD.c5000 = 0;
  1326.    this.gChip.chipD.c25000 = 0;
  1327.    this.gChip.mchip0 = {x:0,y:0};
  1328.    this.gChip.mchip1 = {x:30,y:0};
  1329.    this.gChip.mchip2 = {x:60,y:0};
  1330.    this.gChip.mchip3 = {x:90,y:0};
  1331.    this.gChip.mchip4 = {x:120,y:0};
  1332.    this.gChip.mchip5 = {x:0,y:30};
  1333.    this.gChip.mchip6 = {x:30,y:30};
  1334.    this.gChip.mchip7 = {x:60,y:30};
  1335.    this.gChip.mchip8 = {x:90,y:30};
  1336.    this.gChip.mchip9 = {x:120,y:30};
  1337.    this.gChip.chipBet = {x:334.6,y:235.7};
  1338.    this.gChip.chipBet.c100 = 0;
  1339.    this.gChip.chipBet.c500 = 0;
  1340.    this.gChip.chipBet.c1000 = 0;
  1341.    this.gChip.chipBet.c5000 = 0;
  1342.    this.gChip.chipBet.c25000 = 0;
  1343.    this.gChip.bchip0 = {x:0,y:0};
  1344.    this.gChip.bchip1 = {x:30,y:0};
  1345.    this.gChip.bchip2 = {x:15,y:25};
  1346.    this.gChip.bchip3 = {x:60,y:0};
  1347.    this.gChip.bchip4 = {x:45,y:25};
  1348.    this.gChip.bchip5 = {x:75,y:25};
  1349.    this.gBubble = new Object();
  1350.    if(maxplayers == 5)
  1351.    {
  1352.       this.gBubble.b0 = {sx:61.8,sy:69,lx:61.8,ly:58,tri:1};
  1353.       this.gBubble.b1 = {sx:417.2,sy:67.9,lx:407.2,ly:56.9,tri:1};
  1354.       this.gBubble.b2 = {sx:396,sy:155,lx:375,ly:144,tri:2};
  1355.       this.gBubble.b3 = {sx:250,sy:315,lx:230,ly:304,tri:3};
  1356.       this.gBubble.b4 = {sx:30,sy:232,lx:20,ly:212,tri:3};
  1357.    }
  1358.    else
  1359.    {
  1360.       this.gBubble.b0 = {sx:-2.7,sy:101,lx:-12.7,ly:101,tri:1};
  1361.       this.gBubble.b1 = {sx:461,sy:101,lx:451,ly:101,tri:1};
  1362.       this.gBubble.b3 = {sx:420,sy:230,lx:410,ly:210,tri:3};
  1363.       this.gBubble.b4 = {sx:-2.7,sy:230,lx:-12.7,ly:210,tri:3};
  1364.    }
  1365.    this.gBubble.b5 = {sx:230,sy:12.6,lx:220,ly:1.6,tri:1};
  1366.    this.gBubble.b6 = {sx:230,sy:12.6,lx:220,ly:1.6,tri:1};
  1367.    this.gBubble.b10 = {sx:230,sy:320.6,lx:230,ly:320.6,tri:3};
  1368.    this.gBubble.bspecial = {specialx:207.5,specialy:332.8,lx:0,ly:0,tri:0};
  1369.    var _loc4_ = new Array();
  1370.    _loc3_ = 0;
  1371.    while(_loc3_ < this.currentPlayers.length)
  1372.    {
  1373.       if(this.currentPlayers[_loc3_] != "e")
  1374.       {
  1375.          _loc4_.push(_loc3_);
  1376.       }
  1377.       _loc3_ = _loc3_ + 1;
  1378.    }
  1379.    _loc4_.shuffle();
  1380.    table.attachMovie("dealercontrol","dealerButton",this.mydepth++);
  1381.    this.dealer = _loc4_[0];
  1382.    trace("DEALER #1 = " + this.dealer);
  1383.    this.placeDealerButton(this.currentPlayers[this.dealer]);
  1384.    table.dealerButton._visible = false;
  1385.    this.introDialog();
  1386. }
  1387. function sortChips()
  1388. {
  1389.    p.sortOn("amt",18);
  1390. }
  1391. function getStacks(maxOflow)
  1392. {
  1393.    if(!maxOflow)
  1394.    {
  1395.       maxOflow = 1;
  1396.    }
  1397.    checkAgain = false;
  1398.    numStacks = 1;
  1399.    numOflow = 0;
  1400.    var _loc1_ = 0;
  1401.    while(_loc1_ < 5)
  1402.    {
  1403.       if(p[_loc1_].amt > 0)
  1404.       {
  1405.          numStacks++;
  1406.       }
  1407.       _loc1_ = _loc1_ + 1;
  1408.    }
  1409.    _loc1_ = 0;
  1410.    while(_loc1_ < 5)
  1411.    {
  1412.       if(p[_loc1_].amt > oflow)
  1413.       {
  1414.          if(numStacks >= 6)
  1415.          {
  1416.             numOflow++;
  1417.          }
  1418.          else
  1419.          {
  1420.             numStacks++;
  1421.          }
  1422.       }
  1423.       _loc1_ = _loc1_ + 1;
  1424.    }
  1425.    if(numOflow >= maxOflow)
  1426.    {
  1427.       _loc1_ = 3;
  1428.       while(_loc1_ > -1)
  1429.       {
  1430.          if(p[_loc1_].amt > oflow)
  1431.          {
  1432.             convertChip(_loc1_);
  1433.             numOflow = 0;
  1434.             checkAgain = true;
  1435.             break;
  1436.          }
  1437.          _loc1_ = _loc1_ - 1;
  1438.       }
  1439.    }
  1440. }
  1441. function convertChip(chip)
  1442. {
  1443.    numToGrab = p[chip].amt - oflow;
  1444.    if(numToGrab <= p[chip].tonext)
  1445.    {
  1446.       numToGrab = p[chip].tonext;
  1447.    }
  1448.    else
  1449.    {
  1450.       ok = false;
  1451.       while(ok == false)
  1452.       {
  1453.          var _loc2_ = numToGrab / p[chip].tonext;
  1454.          var _loc1_ = Math.round(numToGrab / p[chip].tonext);
  1455.          if(_loc2_ != _loc1_)
  1456.          {
  1457.             numToGrab++;
  1458.          }
  1459.          else
  1460.          {
  1461.             ok = true;
  1462.          }
  1463.       }
  1464.    }
  1465.    p[chip].amt -= numToGrab;
  1466.    p[chip + 1].amt += numToGrab / p[chip].tonext;
  1467. }
  1468. function TheHand(ds, hp, firsthand)
  1469. {
  1470.    if(!nhrecord)
  1471.    {
  1472.       nhrecord = 1;
  1473.    }
  1474.    else
  1475.    {
  1476.       nhrecord++;
  1477.    }
  1478.    if(nhrecord == blindincrement || nhrecord == blindincrement * 2 || nhrecord == blindincrement * 3 || nhrecord == blindincrement * 4 || nhrecord == blindincrement * 5 || nhrecord == blindincrement * 6 || nhrecord == blindincrement * 7 || nhrecord == blindincrement * 8 || nhrecord == blindincrement * 9)
  1479.    {
  1480.       betLevel++;
  1481.       getBetLevel();
  1482.    }
  1483.    if(!ntrecord)
  1484.    {
  1485.       ntrecord = getTimer();
  1486.    }
  1487.    if(nhrecord == 1)
  1488.    {
  1489.       DoScoreBroadcast();
  1490.    }
  1491.    var _loc3_ = undefined;
  1492.    yup = false;
  1493.    if(!xtraPot)
  1494.    {
  1495.       xtraPot = 0;
  1496.    }
  1497.    this.basicPot = xtraPot;
  1498.    this.potStore = new Array(0,0,0,0,0);
  1499.    this.AllInPool = new Array(0,0,0,0,0);
  1500.    this.currentpot = 0;
  1501.    this.dealerSlot = ds;
  1502.    this.handPlayers = new Array();
  1503.    _loc3_ = 0;
  1504.    while(_loc3_ < hp.length)
  1505.    {
  1506.       this.handPlayers[_loc3_] = hp[_loc3_];
  1507.       table["chipBox" + _loc3_].enchilada = 0;
  1508.       table["chipBox" + _loc3_].mybet = 0;
  1509.       table["pBox" + _loc3_].mybet = 0;
  1510.       _loc3_ = _loc3_ + 1;
  1511.    }
  1512.    trace(this.handPlayers);
  1513.    trace("Starting a new hand!");
  1514.    this.mydepth = 0;
  1515.    this.dealType = new Array("flop","turn","river","end");
  1516.    this.cardOffsetX = 10;
  1517.    this.cardOffsetY = 3;
  1518.    this.betStop = this.dealerSlot;
  1519.    this.betStart = this.returnNextPlayer(this.handPlayers[this.dealerSlot]);
  1520.    this.currentBet = 0;
  1521.    this.commcardcount = 0;
  1522.    this.AllInActive = 0;
  1523.    this.numBettors = 0;
  1524.    this.numRaises = 0;
  1525.    createEmptyMovieClip("arena",_root.rounddepth);
  1526.    this.makePot();
  1527.    if(firsthand)
  1528.    {
  1529.       arena.attachMovie("btn_deal","btn_deal",this.mydepth++);
  1530.       if(maxplayers == 5)
  1531.       {
  1532.          arena.btn_deal._x = 255;
  1533.          arena.btn_deal._y = 245;
  1534.       }
  1535.       else
  1536.       {
  1537.          arena.btn_deal._x = 255;
  1538.          arena.btn_deal._y = 255;
  1539.       }
  1540.       arena.btn_deal.btn.onRelease = function()
  1541.       {
  1542.          dly = 17.7;
  1543.          PlayMusic("MUSIC_INTRO",_root.volM);
  1544.          table.dealerButton._visible = true;
  1545.          _root.mygame.myhand.postAnte();
  1546.          arena.btn_standings.removeMovieClip();
  1547.          this._parent.removeMovieClip();
  1548.       };
  1549.       arena.btn_deal.btn.onPress = function()
  1550.       {
  1551.          _root.buttonSound();
  1552.       };
  1553.       arena.attachMovie("btn_standings","btn_standings",this.mydepth++);
  1554.       if(maxplayers == 5)
  1555.       {
  1556.          arena.btn_standings._x = 255;
  1557.          arena.btn_standings._y = 280;
  1558.       }
  1559.       else
  1560.       {
  1561.          arena.btn_standings._x = 255;
  1562.          arena.btn_standings._y = 290;
  1563.       }
  1564.       arena.btn_standings.btn.onRelease = function()
  1565.       {
  1566.          mygame.myhand.getStandings();
  1567.       };
  1568.       arena.btn_standings.btn.onPress = function()
  1569.       {
  1570.          _root.buttonSound();
  1571.       };
  1572.       mygame.mybubble.makeBubble(5,"Ready to Play?","Press Deal",1,1200);
  1573.       intID0000 = setInterval(dealsound,900);
  1574.    }
  1575.    else
  1576.    {
  1577.       _loc3_ = 0;
  1578.       while(_loc3_ < this.handPlayers.length)
  1579.       {
  1580.          table["pBox" + _loc3_].cover._visible = false;
  1581.          if(mygame.gChip["chip" + _loc3_].c25000 > 0 && (mygame.gChip["chip" + _loc3_].c5000 == 0 || mygame.gChip["chip" + _loc3_].c1000 == 0 || mygame.gChip["chip" + _loc3_].c500 == 0 || mygame.gChip["chip" + _loc3_].c100 == 0))
  1582.          {
  1583.             mygame.colorUpChips(_loc3_);
  1584.          }
  1585.          _loc3_ = _loc3_ + 1;
  1586.       }
  1587.       mygame.moveDealerButton(this.dealerSlot);
  1588.       PlaySoundEffect("SOUND_SHUFFLE");
  1589.       this.postAnte();
  1590.    }
  1591. }
  1592. function betBoxIbutton(str)
  1593. {
  1594.    PlaySoundEffect("SOUND_CHIP2");
  1595.    samt = Number(str.substring(1,8));
  1596.    if(arena.betBox.bal - samt < callamount + minRaise)
  1597.    {
  1598.       ok = false;
  1599.       PlaySoundEffect("SOUND_ATTENTION3");
  1600.    }
  1601.    else
  1602.    {
  1603.       ok = true;
  1604.       PlaySoundEffect("SOUND_CHIP2");
  1605.       mygame.updateBalance(3,samt,"pos");
  1606.       mygame.addClickables(3);
  1607.       arena.betBox.bal -= samt;
  1608.       mygame.gChip.chipBet[str] -= 1;
  1609.       arena.betBox.balance.text = _root.balanceFormat(arena.betBox.bal - callamount,0,",");
  1610.    }
  1611. }
  1612. function chipBoxIbutton(str)
  1613. {
  1614.    PlaySoundEffect("SOUND_CHIP2");
  1615.    samt = Number(str.substring(1,8));
  1616.    mygame.myhand.addToBet(samt);
  1617.    arena.betBox.balance.text = _root.balanceFormat(arena.betBox.bal - callamount,0,",");
  1618.    table.chipBox3.mybalance -= samt;
  1619.    table.chipBox3.enchilada -= samt;
  1620.    mygame.gChip.chip3[str] -= 1;
  1621.    table.chipBox3.balance.text = _root.balanceFormat(table.chipBox3.mybalance,0,",");
  1622. }
  1623. function initAI(who)
  1624. {
  1625.    _level22.initAI(who);
  1626.    arena.attachMovie("aiman","aiman" + who,mygame.myhand.mydepth++);
  1627.    arena["aiman" + who].who = who;
  1628.    arena["aiman" + who].gotoAndStop(2);
  1629. }
  1630. function checkForTies()
  1631. {
  1632.    numTies = 0;
  1633.    i = 0;
  1634.    while(i < wArray.length)
  1635.    {
  1636.       if(wArray[i].a != wArray[i + 1].a)
  1637.       {
  1638.          i = 500;
  1639.          break;
  1640.       }
  1641.       numTies++;
  1642.       i++;
  1643.    }
  1644.    if(numTies > 0)
  1645.    {
  1646.       return true;
  1647.    }
  1648.    return false;
  1649. }
  1650. function getWinner(whoArray)
  1651. {
  1652.    wArray = new Array();
  1653.    var _loc2_ = 0;
  1654.    while(_loc2_ < whoArray.length)
  1655.    {
  1656.       wArray.push({seat:whoArray[_loc2_],a:_root["bestHand" + whoArray[_loc2_]][0].a});
  1657.       _loc2_ = _loc2_ + 1;
  1658.    }
  1659.    wArray.sortOn("a",18);
  1660.    who = wArray[0].seat;
  1661.    winnerName = table["pBox" + who].myname.text;
  1662.    winnings = arena.potBox.bal;
  1663.    count = 0;
  1664.    intID0011 = setInterval(winScript,1750);
  1665.    trace("WINNER = " + wArray[0].seat + " NAME = " + table["pBox" + wArray[0].seat].myname.text);
  1666.    trace("HAND = " + _root["bestHand" + wArray[0].seat][0].h);
  1667. }
  1668. function winScript()
  1669. {
  1670.    if(pauseOn == false)
  1671.    {
  1672.       if(count == 0)
  1673.       {
  1674.          PlaySoundEffect("SOUND_CHEER");
  1675.          mygame.mybubble.makeBubble(5,"And the winner is...","blank",1,0);
  1676.       }
  1677.       else if(count == 1)
  1678.       {
  1679.          PlaySoundEffect("SOUND_CLAP2");
  1680.          mygame.mybubble.makeBubble(5,winnerName,"blank",1,0);
  1681.       }
  1682.       else if(count == 2)
  1683.       {
  1684.          PlaySoundEffect("SOUND_CLAP3");
  1685.          subwinnings = winnings + table["chipBox" + who].enchilada;
  1686.          trace(subwinnings + " -- " + table["chipBox" + who].enchilada + "   winner stuf");
  1687.          mygame.updateBalance(who,arena.potBox.bal,"pos");
  1688.          var _loc5_ = undefined;
  1689.          var _loc3_ = 0;
  1690.          while(_loc3_ < mygame.myhand.handPlayers.length)
  1691.          {
  1692.             _loc5_ = table["chipBox" + _loc3_].enchilada;
  1693.             if(_loc5_ < 0)
  1694.             {
  1695.                _loc5_ -= _loc5_ * 2;
  1696.             }
  1697.             table["pBox" + _loc3_].statusBox.display.text = "Lost " + _root.balanceFormat(_loc5_,0,",");
  1698.             table["pBox" + _loc3_].statusBox.colorBox.gotoAndStop(1);
  1699.             _loc3_ = _loc3_ + 1;
  1700.          }
  1701.          table["chipBox" + who]._visible = true;
  1702.          table["pBox" + who].statusBox.display.text = "Won " + _root.balanceFormat(subwinnings,0,",");
  1703.          table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
  1704.          trace("--------------");
  1705.          trace("WINNERS BALANCE   " + table["chipBox" + who].mybalance);
  1706.          arena.potBox.bal = 0;
  1707.          arena.potBox.removeMovieClip();
  1708.          DoScoreBroadcast();
  1709.       }
  1710.       else if(count == 3)
  1711.       {
  1712.          PlaySoundEffect("SOUND_CLAP1");
  1713.          mygame.mybubble.makeBubble(6,winnerName + " wins",_root.balanceFormat(subwinnings,0,","),3,0);
  1714.       }
  1715.       count++;
  1716.       if(count >= 5)
  1717.       {
  1718.          var _loc7_ = _root.bigblind;
  1719.          var _loc8_ = _root.ante;
  1720.          if(nhrecord == blindincrement || nhrecord == blindincrement * 2 || nhrecord == blindincrement * 3 || nhrecord == blindincrement * 4 || nhrecord == blindincrement * 5 || nhrecord == blindincrement * 6 || nhrecord == blindincrement * 7 || nhrecord == blindincrement * 8 || nhrecord == blindincrement * 9)
  1721.          {
  1722.             var _loc9_ = betLevel + 1;
  1723.             _loc7_ = prePay[_loc9_][0];
  1724.             _loc8_ = prePay[_loc9_][2];
  1725.          }
  1726.          var _loc6_ = new Array();
  1727.          var _loc4_ = 0;
  1728.          while(_loc4_ < mygame.myhand.handPlayers.length)
  1729.          {
  1730.             if(table["chipBox" + _loc4_].mybalance <= _loc7_ + _loc8_ && table["chipBox" + _loc4_].mybalance != undefined)
  1731.             {
  1732.                _loc6_.push(_loc4_);
  1733.             }
  1734.             _loc4_ = _loc4_ + 1;
  1735.          }
  1736.          if(_loc6_.length > 0)
  1737.          {
  1738.             sayGoodbye(_loc6_);
  1739.             clearInterval(intID0011);
  1740.          }
  1741.          else
  1742.          {
  1743.             trace("Got here");
  1744.             if(_global.noZoneAPI == true)
  1745.             {
  1746.                trace("no zone");
  1747.                trace(isGameTimerActive);
  1748.                if(isGameTimerActive == true)
  1749.                {
  1750.                   var _loc10_ = getTimer();
  1751.                   if(_loc10_ > gameStartTime + gametimer)
  1752.                   {
  1753.                      if(timeraction == "allin")
  1754.                      {
  1755.                         botsDoAll = true;
  1756.                         getDealStandings();
  1757.                      }
  1758.                      else
  1759.                      {
  1760.                         tableMenu.removeMovieClip();
  1761.                         mygame.myhand.getStandings("expired");
  1762.                      }
  1763.                   }
  1764.                   else
  1765.                   {
  1766.                      getDealStandings();
  1767.                   }
  1768.                }
  1769.                else
  1770.                {
  1771.                   trace(maxHandsAllowed + "  === " + numHandsPlayed);
  1772.                   if(maxHandsAllowed > 0)
  1773.                   {
  1774.                      numHandsPlayed++;
  1775.                      if(numHandsPlayed == maxHandsAllowed)
  1776.                      {
  1777.                         if(timeraction == "allin")
  1778.                         {
  1779.                            botsDoAll = true;
  1780.                            getDealStandings();
  1781.                         }
  1782.                         else
  1783.                         {
  1784.                            tableMenu.removeMovieClip();
  1785.                            mygame.myhand.getStandings("maxed");
  1786.                         }
  1787.                      }
  1788.                      else
  1789.                      {
  1790.                         getDealStandings();
  1791.                      }
  1792.                   }
  1793.                   else
  1794.                   {
  1795.                      getDealStandings();
  1796.                   }
  1797.                }
  1798.             }
  1799.             else if(gamebreaker > numHandsPlayedX + 1)
  1800.             {
  1801.                numHandsPlayedX++;
  1802.                numHandsPlayed++;
  1803.                getDealStandings();
  1804.             }
  1805.             else
  1806.             {
  1807.                numHandsPlayedX = 0;
  1808.                DoGameBreak();
  1809.             }
  1810.             clearInterval(intID0011);
  1811.          }
  1812.       }
  1813.    }
  1814. }
  1815. function getDealStandings()
  1816. {
  1817.    PlaySoundEffect("SOUND_SHUFFLE");
  1818.    var _loc3_ = 0;
  1819.    while(_loc3_ < mygame.currentPlayers.length)
  1820.    {
  1821.       if(mygame.currentPlayers[_loc3_] != "e")
  1822.       {
  1823.          table["chipBox" + _loc3_]._visible = true;
  1824.       }
  1825.       _loc3_ = _loc3_ + 1;
  1826.    }
  1827.    arena.attachMovie("btn_deal","btn_deal",mygame.myhand.mydepth++);
  1828.    if(maxplayers == 5)
  1829.    {
  1830.       arena.btn_deal._x = 175;
  1831.       arena.btn_deal._y = 283;
  1832.    }
  1833.    else
  1834.    {
  1835.       arena.btn_deal._x = 255;
  1836.       arena.btn_deal._y = 255;
  1837.    }
  1838.    arena.btn_deal.btn.onRelease = function()
  1839.    {
  1840.       killTheHand();
  1841.       var _loc3_ = mygame.nextDealer(mygame.dealer);
  1842.       mygame.dealer = _loc3_;
  1843.       _root.mygame.myhand = new TheHand(_loc3_,mygame.currentPlayers);
  1844.       arena.btn_standings.removeMovieClip();
  1845.       this.removeMovieClip();
  1846.    };
  1847.    arena.btn_deal.btn.onPress = function()
  1848.    {
  1849.       _root.buttonSound();
  1850.    };
  1851.    arena.attachMovie("btn_standings","btn_standings",mygame.myhand.mydepth++);
  1852.    if(maxplayers == 5)
  1853.    {
  1854.       arena.btn_standings._x = 175;
  1855.       arena.btn_standings._y = 316;
  1856.    }
  1857.    else
  1858.    {
  1859.       arena.btn_standings._x = 255;
  1860.       arena.btn_standings._y = 290;
  1861.    }
  1862.    arena.btn_standings.btn.onRelease = function()
  1863.    {
  1864.       mygame.mybubble.killBubble(5);
  1865.       mygame.mybubble.killBubble(6);
  1866.       mygame.myhand.getStandings();
  1867.    };
  1868.    arena.btn_standings.btn.onPress = function()
  1869.    {
  1870.       _root.buttonSound();
  1871.    };
  1872. }
  1873. function killTheHand()
  1874. {
  1875.    delete playerKill;
  1876.    delete gbcount;
  1877.    delete pkcount;
  1878.    delete mytry;
  1879.    delete playerIsInTheGame;
  1880.    mygame.gChip.chipD.c100 = 0;
  1881.    mygame.gChip.chipD.c500 = 0;
  1882.    mygame.gChip.chipD.c1000 = 0;
  1883.    mygame.gChip.chipD.c5000 = 0;
  1884.    mygame.gChip.chipD.c25000 = 0;
  1885.    delete mygame.myhand;
  1886.    mygame.mybubble.killBubble(5);
  1887.    mygame.mybubble.killBubble(6);
  1888.    arena.removeMovieClip();
  1889. }
  1890. function killTheGame(type)
  1891. {
  1892.    nhrecord = 0;
  1893.    ntrecord = getTimer();
  1894.    clearInterval(gijoe);
  1895.    clearInterval(intID0000);
  1896.    clearInterval(intID0001);
  1897.    clearInterval(intID0002);
  1898.    clearInterval(intID0003);
  1899.    clearInterval(intID0004);
  1900.    clearInterval(intID0005);
  1901.    clearInterval(intID0006);
  1902.    clearInterval(intID0007);
  1903.    clearInterval(intID0008);
  1904.    clearInterval(intID0009);
  1905.    clearInterval(intID0010);
  1906.    clearInterval(intID00011);
  1907.    clearInterval(intID00015);
  1908.    clearInterval(intID00016);
  1909.    clearInterval(intID00017);
  1910.    clearInterval(intID00018);
  1911.    clearInterval(killme);
  1912.    trace("killing game now");
  1913.    killTheHand();
  1914.    unloadAI();
  1915.    arena.standings.removeMovieClip();
  1916.    table.removeMovieClip();
  1917.    tableMenu.removeMovieClip();
  1918.    delete mygame;
  1919.    delete ideal;
  1920.    delete numOflow;
  1921.    delete numStacks;
  1922.    delete xtraPot;
  1923.    delete p;
  1924.    delete mycontinue;
  1925.    delete count;
  1926.    delete cardcount;
  1927.    delete cc;
  1928.    delete cb;
  1929.    delete callamount;
  1930.    delete amt;
  1931.    delete ii;
  1932.    delete faction;
  1933.    delete aibet;
  1934.    delete inc;
  1935.    delete num;
  1936.    delete toinc;
  1937.    delete aiaction;
  1938.    delete k;
  1939.    delete myallin;
  1940.    delete x0;
  1941.    delete x1;
  1942.    delete x2;
  1943.    delete x3;
  1944.    delete x4;
  1945.    delete x5;
  1946.    delete x6;
  1947.    delete x7;
  1948.    delete bestHand0;
  1949.    delete cAr;
  1950.    delete hAr;
  1951.    delete ycard1;
  1952.    delete ycard2;
  1953.    delete ycard3;
  1954.    delete ycard4;
  1955.    delete ycard5;
  1956.    delete ycard6;
  1957.    delete ycard7;
  1958.    delete yz1;
  1959.    delete yz2;
  1960.    delete yz3;
  1961.    delete yz4;
  1962.    delete yz5;
  1963.    delete yz6;
  1964.    delete yz7;
  1965.    delete playerHand;
  1966.    delete pairNum0;
  1967.    delete pairNum1;
  1968.    delete straight;
  1969.    delete flush;
  1970.    delete hc;
  1971.    delete hh1;
  1972.    delete hh2;
  1973.    delete hh3;
  1974.    delete hh4;
  1975.    delete hh5;
  1976.    delete thisPair0;
  1977.    delete thisPair1;
  1978.    delete bestHand;
  1979.    delete dval;
  1980.    delete handText;
  1981.    delete aNumber;
  1982.    delete pos;
  1983.    delete bestHand1;
  1984.    delete wom0;
  1985.    delete wom2;
  1986.    delete wom1;
  1987.    delete bestHand2;
  1988.    delete bestHand3;
  1989.    delete bestHand4;
  1990.    delete bestHand5;
  1991.    delete wom;
  1992.    delete dval2;
  1993.    delete wArray;
  1994.    delete numTies;
  1995.    delete tie;
  1996.    delete mywho;
  1997.    delete winnerName;
  1998.    delete winnerLastName;
  1999.    delete winnings;
  2000.    delete divider;
  2001.    delete tmpcard;
  2002.    delete tmploc;
  2003.    delete who;
  2004.    delete cashback;
  2005.    delete mylost;
  2006.    delete origmylost;
  2007.    delete killme;
  2008.    delete finalscore;
  2009.    delete totalTimePlayed;
  2010.    delete powerranking;
  2011.    delete myrank;
  2012.    delete attachNOchips;
  2013.    delete amountToCall;
  2014.    delete adjustedWinnings;
  2015.    delete adjustedWinnings2;
  2016.    loadAI();
  2017.    if(type == "defer")
  2018.    {
  2019.       initMenu(true);
  2020.       stopAllSounds();
  2021.    }
  2022.    else if(type == "new")
  2023.    {
  2024.       mygame = new Game();
  2025.    }
  2026.    else
  2027.    {
  2028.       initMenu(true,"nosound");
  2029.    }
  2030. }
  2031. function initAllin()
  2032. {
  2033.    myallin = new AllinScreen();
  2034. }
  2035. myversion = "v1.11.00";
  2036. Array.prototype.shuffle = function()
  2037. {
  2038.    var _loc2_ = this.length;
  2039.    while(_loc2_)
  2040.    {
  2041.       var _loc3_ = random(_loc2_);
  2042.       var _loc4_ = this[_loc2_ = _loc2_ - 1];
  2043.       this[_loc2_] = this[_loc3_];
  2044.       this[_loc3_] = _loc4_;
  2045.    }
  2046. };
  2047. MovieClip.prototype.fadeTo = function(v_alpha, vel, type)
  2048. {
  2049.    this.onEnterFrame = function()
  2050.    {
  2051.       var _loc2_ = this._alpha;
  2052.       if(type == "out")
  2053.       {
  2054.          this._alpha -= (this._alpha - v_alpha) / vel;
  2055.          if(Math.abs(this._alpha - v_alpha) < 1 || _loc2_ == this._alpha)
  2056.          {
  2057.             this._alpha = v_alpha;
  2058.             this.onEnterFrame = null;
  2059.          }
  2060.       }
  2061.       if(type == "in")
  2062.       {
  2063.          this._alpha += (this._alpha + v_alpha) / vel;
  2064.          if(Math.abs(this._alpha + v_alpha) > 199 || _loc2_ == this._alpha)
  2065.          {
  2066.             this._alpha = v_alpha;
  2067.             this.onEnterFrame = null;
  2068.          }
  2069.       }
  2070.    };
  2071. };
  2072. MovieClip.prototype.goToPoint = function(x, y, vel, kill)
  2073. {
  2074.    var _loc4_ = undefined;
  2075.    var _loc3_ = undefined;
  2076.    var _loc6_ = undefined;
  2077.    var _loc5_ = undefined;
  2078.    var movX;
  2079.    var movY;
  2080.    !!vel ? null : (vel = 10);
  2081.    _loc4_ = this._x;
  2082.    _loc3_ = this._y;
  2083.    _loc6_ = Math.round(x - _loc4_);
  2084.    _loc5_ = Math.round(y - _loc3_);
  2085.    movX = _loc6_ / vel;
  2086.    movY = _loc5_ / vel;
  2087.    var movetype = 0;
  2088.    if(movX < 0 && movY < 0)
  2089.    {
  2090.       movetype = 1;
  2091.    }
  2092.    if(movX > 0 && movY < 0)
  2093.    {
  2094.       movetype = 2;
  2095.    }
  2096.    if(movX > 0 && movY > 0)
  2097.    {
  2098.       movetype = 3;
  2099.    }
  2100.    if(movX < 0 && movY > 0)
  2101.    {
  2102.       movetype = 4;
  2103.    }
  2104.    var movecount = 0;
  2105.    this.onEnterFrame = function()
  2106.    {
  2107.       endthis = false;
  2108.       this._y == y ? null : (this._y += movY);
  2109.       this._x == x ? null : (this._x += movX);
  2110.       if(movetype == 1 && this._y <= y && this._x <= x)
  2111.       {
  2112.          endthis = true;
  2113.       }
  2114.       if(movetype == 2 && this._y <= y && this._x >= x)
  2115.       {
  2116.          endthis = true;
  2117.       }
  2118.       if(movetype == 3 && this._y >= y && this._x >= x)
  2119.       {
  2120.          endthis = true;
  2121.       }
  2122.       if(movetype == 4 && this._y >= y && this._x <= x)
  2123.       {
  2124.          endthis = true;
  2125.       }
  2126.       movecount++;
  2127.       if(movecount > 25)
  2128.       {
  2129.          endthis = true;
  2130.       }
  2131.       if(endthis == true)
  2132.       {
  2133.          this._x = x;
  2134.          this._y = y;
  2135.          if(kill == true)
  2136.          {
  2137.             this.removeMovieClip();
  2138.          }
  2139.          this.onEnterFrame = null;
  2140.       }
  2141.    };
  2142. };
  2143. balanceFormat = function(uknumValue, uknPlaces, strSeparator)
  2144. {
  2145.    strResult = "";
  2146.    var _loc6_ = false;
  2147.    var _loc9_ = false;
  2148.    if(typeof uknumValue == "string")
  2149.    {
  2150.       var _loc4_ = parseFloat(uknumValue);
  2151.       if(isNaN(_loc4_))
  2152.       {
  2153.          _loc6_ = true;
  2154.       }
  2155.    }
  2156.    else if(typeof uknumValue == "number")
  2157.    {
  2158.       _loc4_ = uknumValue;
  2159.    }
  2160.    else
  2161.    {
  2162.       _loc6_ = true;
  2163.    }
  2164.    if(typeof uknPlaces == "string")
  2165.    {
  2166.       var _loc5_ = !(uknPlaces == "" || uknPlaces == null) ? parseInt(uknPlaces) : 0;
  2167.       if(isNaN(_loc5_))
  2168.       {
  2169.          _loc9_ = true;
  2170.       }
  2171.    }
  2172.    else if(typeof uknPlaces == "number")
  2173.    {
  2174.       _loc5_ = uknPlaces;
  2175.    }
  2176.    else
  2177.    {
  2178.       _loc9_ = true;
  2179.    }
  2180.    if(_loc6_ || _loc9_)
  2181.    {
  2182.       strResult = !(_loc6_ && _loc9_) ? "" : "bad Value & bad Places";
  2183.       strResult = !!_loc6_ ? "bad Value" : "bad Places";
  2184.    }
  2185.    else
  2186.    {
  2187.       var _loc12_ = Math.pow(10,_loc5_);
  2188.       _loc4_ = Math.round(_loc4_ * _loc12_);
  2189.       var _loc10_ = _loc5_ <= 0 ? "" : "." + String(_loc4_).substr(String(_loc4_).length - _loc5_);
  2190.       var _loc3_ = String(_loc4_).substr(0,String(_loc4_).length - _loc5_);
  2191.       strValue = String(parseFloat(strValue));
  2192.       var _loc2_ = _loc3_.length;
  2193.       numTriple = Math.floor((_loc2_ - 1) / 3);
  2194.       numRemainder = (_loc2_ - 1) % 3 + 1;
  2195.       var _loc1_ = 0;
  2196.       while(_loc1_ < numTriple)
  2197.       {
  2198.          strResult = strSeparator + _loc3_.substr(_loc2_ - 3 * (_loc1_ + 1),3) + strResult;
  2199.          _loc1_ = _loc1_ + 1;
  2200.       }
  2201.       if(numRemainder)
  2202.       {
  2203.          strResult = _loc3_.substr(0,numRemainder) + strResult;
  2204.       }
  2205.       if(_loc5_ && _loc10_.length)
  2206.       {
  2207.          strResult = strResult != "" ? strResult : "0";
  2208.          strResult += _loc10_;
  2209.       }
  2210.    }
  2211.    return "$" + strResult;
  2212. };
  2213. idealChips = function(amt)
  2214. {
  2215.    var _loc4_ = new Array(0,0,0,0,0);
  2216.    var _loc2_ = amt;
  2217.    var _loc3_ = 0;
  2218.    if(_loc2_ >= 25000)
  2219.    {
  2220.       _loc3_ = 0;
  2221.       var _loc1_ = 25000;
  2222.       while(_loc1_ < _loc2_ + 1)
  2223.       {
  2224.          if(_loc2_ >= _loc1_)
  2225.          {
  2226.             _loc3_ = _loc3_ + 1;
  2227.          }
  2228.          _loc1_ += 25000;
  2229.       }
  2230.       _loc4_[4] = _loc3_;
  2231.       _loc2_ -= 25000 * _loc3_;
  2232.    }
  2233.    if(_loc2_ >= 5000 && _loc2_ < 25000)
  2234.    {
  2235.       _loc3_ = 0;
  2236.       _loc1_ = 5000;
  2237.       while(_loc1_ < 25000)
  2238.       {
  2239.          if(_loc2_ >= _loc1_)
  2240.          {
  2241.             _loc3_ = _loc3_ + 1;
  2242.          }
  2243.          _loc1_ += 5000;
  2244.       }
  2245.       _loc4_[3] = _loc3_;
  2246.       _loc2_ -= 5000 * _loc3_;
  2247.    }
  2248.    if(_loc2_ >= 1000 && _loc2_ < 5000)
  2249.    {
  2250.       _loc3_ = 0;
  2251.       _loc1_ = 1000;
  2252.       while(_loc1_ < 5000)
  2253.       {
  2254.          if(_loc2_ >= _loc1_)
  2255.          {
  2256.             _loc3_ = _loc3_ + 1;
  2257.          }
  2258.          _loc1_ += 1000;
  2259.       }
  2260.       _loc4_[2] = _loc3_;
  2261.       _loc2_ -= 1000 * _loc3_;
  2262.    }
  2263.    if(_loc2_ >= 500 && _loc2_ < 1000)
  2264.    {
  2265.       _loc4_[1] = 1;
  2266.       _loc2_ -= 500;
  2267.    }
  2268.    if(_loc2_ >= 100 && _loc2_ < 500)
  2269.    {
  2270.       _loc3_ = 0;
  2271.       _loc1_ = 100;
  2272.       while(_loc1_ < 500)
  2273.       {
  2274.          if(_loc2_ >= _loc1_)
  2275.          {
  2276.             _loc3_ = _loc3_ + 1;
  2277.          }
  2278.          _loc1_ += 100;
  2279.       }
  2280.       _loc4_[0] = _loc3_;
  2281.       _loc2_ -= _loc3_ * 100;
  2282.    }
  2283.    return _loc4_;
  2284. };
  2285. _root.gFake = _global.noZoneAPI;
  2286. _root.gBreakId = 1;
  2287. _root.gGameStartTime = getTimer();
  2288. _root.settings = new XML();
  2289. _root.settings.getSetting = function(what)
  2290. {
  2291.    var _loc5_ = this.childNodes;
  2292.    var _loc6_ = _loc5_.length;
  2293.    var _loc2_ = 0;
  2294.    while(_loc2_ < _loc6_)
  2295.    {
  2296.       var _loc3_ = _loc5_[_loc2_].nodeName;
  2297.       var _loc4_ = _loc5_[_loc2_].childNodes[0].nodeValue;
  2298.       if(what == _loc3_)
  2299.       {
  2300.          return _loc4_;
  2301.       }
  2302.       _loc2_ = _loc2_ + 1;
  2303.    }
  2304.    return null;
  2305. };
  2306. _root.settings.onLoad = function(bSuccess)
  2307. {
  2308.    if(bSuccess)
  2309.    {
  2310.       var _loc3_ = this.getSetting("scorebroadcastinterval");
  2311.       if(_loc3_ != null)
  2312.       {
  2313.          _global.scorebroadcastinterval = _loc3_;
  2314.       }
  2315.       _loc3_ = this.getSetting("logo");
  2316.       if(_loc3_ != null)
  2317.       {
  2318.          _global.logo = _loc3_;
  2319.       }
  2320.       _loc3_ = this.getSetting("file_path");
  2321.       if(_loc3_ != null)
  2322.       {
  2323.          mypath = _loc3_ + "help.txt";
  2324.       }
  2325.       _loc3_ = this.getSetting("maxlevels");
  2326.       if(_loc3_ != null)
  2327.       {
  2328.          gamebreaker = Number(_loc3_);
  2329.       }
  2330.       _loc3_ = this.getSetting("logobufferx");
  2331.       if(_loc3_ != null)
  2332.       {
  2333.          logobufferx = Number(_loc3_);
  2334.       }
  2335.       _loc3_ = this.getSetting("logobuffery");
  2336.       if(_loc3_ != null)
  2337.       {
  2338.          logobuffery = Number(_loc3_);
  2339.       }
  2340.       _loc3_ = this.getSetting("blindincrement");
  2341.       if(_loc3_ != null)
  2342.       {
  2343.          blindincrement = Number(_loc3_);
  2344.       }
  2345.       _loc3_ = this.getSetting("gametimer");
  2346.       if(_loc3_ != null)
  2347.       {
  2348.          gametimer = Number(_loc3_);
  2349.       }
  2350.       _loc3_ = this.getSetting("timertype");
  2351.       if(_loc3_ != null)
  2352.       {
  2353.          timertype = _loc3_;
  2354.          if(timertype == "hands")
  2355.          {
  2356.             maxHandsAllowed = gametimer;
  2357.          }
  2358.          else
  2359.          {
  2360.             gametimer *= 1000;
  2361.             isGameTimerActive = true;
  2362.          }
  2363.       }
  2364.       _loc3_ = this.getSetting("timeraction");
  2365.       if(_loc3_ != null)
  2366.       {
  2367.          timeraction = _loc3_;
  2368.       }
  2369.       trace("GT  " + gametimer);
  2370.       trace("is GT " + isGameTimerActive);
  2371.       trace("maxhands   " + maxHandsAllowed);
  2372.       trace("timeraction = " + timeraction);
  2373.       _loc3_ = this.getSetting("download");
  2374.       if(_loc3_ != null)
  2375.       {
  2376.          _global.download = _loc3_;
  2377.       }
  2378.       else
  2379.       {
  2380.          _global.realmode = true;
  2381.       }
  2382.       _loc3_ = this.getSetting("downloadtype");
  2383.       if(_loc3_ != null)
  2384.       {
  2385.          _global.downloadtype = _loc3_;
  2386.       }
  2387.       _loc3_ = this.getSetting("shockwave");
  2388.       if(_loc3_ != null)
  2389.       {
  2390.          _global.noZoneAPI = true;
  2391.          _global.shockwave = true;
  2392.       }
  2393.       _loc3_ = this.getSetting("zone");
  2394.       if(_loc3_ != null)
  2395.       {
  2396.          _global.noZoneAPI = false;
  2397.          _global.realmode = false;
  2398.       }
  2399.       else
  2400.       {
  2401.          _global.noZoneAPI = true;
  2402.       }
  2403.    }
  2404.    if(_global.noZoneAPI == true)
  2405.    {
  2406.       initSplashScreen(_global.logo);
  2407.    }
  2408.    else
  2409.    {
  2410.       initSplashScreen(_global.logo,true);
  2411.    }
  2412. };
  2413. clearInterval(hubTimer);
  2414. Bubble.prototype.makeBubble = function(who, msg0, msg1, mycolor, fader)
  2415. {
  2416.    if(who == 5 || who == 6 || who == 10 || who == "special")
  2417.    {
  2418.       PlaySoundEffect("SOUND_ATTENTION4");
  2419.       this.killBubble(who);
  2420.    }
  2421.    var _loc4_ = "";
  2422.    if(msg1 != "blank")
  2423.    {
  2424.       _loc4_ = "l";
  2425.    }
  2426.    else
  2427.    {
  2428.       _loc4_ = "s";
  2429.    }
  2430.    if(who == "special")
  2431.    {
  2432.       _loc4_ = "special";
  2433.    }
  2434.    var _loc5_ = mygame.gBubble["b" + who].tri;
  2435.    var _loc7_ = mygame.gBubble["b" + who][_loc4_ + "x"];
  2436.    var _loc6_ = mygame.gBubble["b" + who][_loc4_ + "y"];
  2437.    bubbles.attachMovie("bubble" + _loc4_,"bubble" + who,this.mydepth++);
  2438.    bubbles["bubble" + who]._x = _loc7_;
  2439.    bubbles["bubble" + who]._y = _loc6_;
  2440.    bubbles["bubble" + who].msg0.text = msg0;
  2441.    bubbles["bubble" + who].msg1.text = msg1;
  2442.    var _loc2_ = 0;
  2443.    while(_loc2_ < 4)
  2444.    {
  2445.       bubbles["bubble" + who]["t" + _loc2_]._visible = false;
  2446.       _loc2_ = _loc2_ + 1;
  2447.    }
  2448.    bubbles["bubble" + who]["t" + _loc5_]._visible = true;
  2449.    bubbles["bubble" + who]["t" + _loc5_].gotoAndStop(mycolor);
  2450.    bubbles["bubble" + who].gotoAndStop(mycolor);
  2451.    if(fader > 0)
  2452.    {
  2453.       this.fadeBubble(who,fader);
  2454.    }
  2455. };
  2456. Bubble.prototype.fadeBubble = function(who, wait)
  2457. {
  2458.    bubbles["bubble" + who].onEnterFrame = function()
  2459.    {
  2460.       bubbles["bubble" + who].wait = wait;
  2461.       if(!bubbles["bubble" + who].start)
  2462.       {
  2463.          bubbles["bubble" + who].start = getTimer();
  2464.       }
  2465.       if(bubbles["bubble" + who].start + bubbles["bubble" + who].wait < getTimer())
  2466.       {
  2467.          bubbles["bubble" + who]._alpha -= 34;
  2468.          if(bubbles["bubble" + who]._alpha <= 0)
  2469.          {
  2470.             bubbles["bubble" + who].removeMovieClip();
  2471.          }
  2472.       }
  2473.    };
  2474. };
  2475. Bubble.prototype.killBubble = function(who)
  2476. {
  2477.    if(who)
  2478.    {
  2479.       bubbles["bubble" + who].removeMovieClip();
  2480.    }
  2481.    else
  2482.    {
  2483.       var _loc1_ = 0;
  2484.       while(_loc1_ < 7)
  2485.       {
  2486.          bubbles["bubble" + _loc1_].removeMovieClip();
  2487.          _loc1_ = _loc1_ + 1;
  2488.       }
  2489.    }
  2490. };
  2491. scoreHand = function(hand)
  2492. {
  2493.    var i;
  2494.    i = 0;
  2495.    while(i < 7)
  2496.    {
  2497.       var divider = 0;
  2498.       var suit = 1;
  2499.       if(hand[i] > 13 && hand[i] < 27)
  2500.       {
  2501.          suit = 2;
  2502.          divider = 13;
  2503.       }
  2504.       else if(hand[i] > 26 && hand[i] < 40)
  2505.       {
  2506.          suit = 3;
  2507.          divider = 26;
  2508.       }
  2509.       else if(hand[i] > 39)
  2510.       {
  2511.          suit = 4;
  2512.          divider = 39;
  2513.       }
  2514.       this["ycard" + (i + 1)] = hand[i] - divider;
  2515.       this["yz" + (i + 1)] = suit;
  2516.       i++;
  2517.    }
  2518.    i = 1;
  2519.    while(i < 6)
  2520.    {
  2521.       if(this["ycard" + i] == 1)
  2522.       {
  2523.          this["ycard" + i] = 14;
  2524.       }
  2525.       i++;
  2526.    }
  2527.    var sort = 0;
  2528.    while(sort == 0)
  2529.    {
  2530.       sort = 1;
  2531.       var j = 1;
  2532.       var tmp = 0;
  2533.       while(j < 5)
  2534.       {
  2535.          if(eval("ycard" + j) > eval("ycard" + (j + 1)))
  2536.          {
  2537.             sort = 0;
  2538.             tmp = eval("ycard" + j);
  2539.             set("ycard" + j,eval("ycard" + (j + 1)));
  2540.             set("ycard" + (j + 1),tmp);
  2541.             tmp = eval("yz" + j);
  2542.             set("yz" + j,eval("yz" + (j + 1)));
  2543.             set("yz" + (j + 1),tmp);
  2544.          }
  2545.          j += 1;
  2546.       }
  2547.    }
  2548.    playerHand = 0;
  2549.    pairNum0 = 0;
  2550.    pairNum1 = 0;
  2551.    i = 2;
  2552.    var u0 = 0;
  2553.    var u1 = 0;
  2554.    var un = 0;
  2555.    while(i < 6)
  2556.    {
  2557.       if(eval("ycard" + i) == eval("ycard" + (i - 1)))
  2558.       {
  2559.          set("u" + un,eval("u" + un) + 1);
  2560.          set("pairNum" + un,eval("ycard" + i));
  2561.       }
  2562.       else if(eval("u" + un) > 0)
  2563.       {
  2564.          un += 1;
  2565.       }
  2566.       i += 1;
  2567.    }
  2568.    if(u0 == 3)
  2569.    {
  2570.       playerHand = 7;
  2571.    }
  2572.    if(u0 == 2)
  2573.    {
  2574.       playerHand = 3;
  2575.    }
  2576.    if(u0 == 1)
  2577.    {
  2578.       playerHand = 1;
  2579.       if(_root.gamemode == 1 && pairNum0 < 11)
  2580.       {
  2581.          playerHand = 0;
  2582.       }
  2583.    }
  2584.    if(u0 == 2 && u1 == 1 || u0 == 1 && u1 == 2)
  2585.    {
  2586.       if(u0 == 2)
  2587.       {
  2588.          tmpPN = pairNum0;
  2589.          tmpPN2 = pairNum1;
  2590.       }
  2591.       else
  2592.       {
  2593.          tmpPN = pairNum1;
  2594.          tmpPN2 = pairNum0;
  2595.       }
  2596.       pairNum0 = tmpPN;
  2597.       pairNum1 = tmpPN2;
  2598.       playerHand = 6;
  2599.    }
  2600.    if(u0 == 1 && u1 == 1)
  2601.    {
  2602.       playerHand = 2;
  2603.    }
  2604.    i = 2;
  2605.    straight = 1;
  2606.    while(i < 6)
  2607.    {
  2608.       if(eval("ycard" + i) != eval("ycard" + (i - 1)) + 1)
  2609.       {
  2610.          straight = 0;
  2611.       }
  2612.       i += 1;
  2613.    }
  2614.    if(straight == 1 || ycard5 == 14 && ycard2 == 3 && ycard3 == 4 && ycard4 == 5 && ycard1 == 2)
  2615.    {
  2616.       straight = 1;
  2617.       playerHand = 4;
  2618.    }
  2619.    i = 2;
  2620.    flush = 1;
  2621.    while(i < 6)
  2622.    {
  2623.       if(eval("yz" + i) != eval("yz" + (i - 1)))
  2624.       {
  2625.          flush = 0;
  2626.       }
  2627.       i += 1;
  2628.    }
  2629.    if(flush == 1)
  2630.    {
  2631.       playerHand = 5;
  2632.    }
  2633.    if(straight == 1 && flush == 1)
  2634.    {
  2635.       playerHand = 8;
  2636.    }
  2637.    if(straight == 1 && flush == 1 && ycard1 == 10 && ycard5 == 14)
  2638.    {
  2639.       playerHand = 9;
  2640.    }
  2641.    notateHand();
  2642. };
  2643. notateHand = function()
  2644. {
  2645.    var i;
  2646.    var a;
  2647.    hc = 0;
  2648.    hh1 = ycard1;
  2649.    hh2 = ycard2;
  2650.    hh3 = ycard3;
  2651.    hh4 = ycard4;
  2652.    hh5 = ycard5;
  2653.    thisPair0 = pairNum0;
  2654.    thisPair1 = pairNum1;
  2655.    bestHand = new Array();
  2656.    bestHand.push(playerHand);
  2657.    if(playerHand == 0)
  2658.    {
  2659.       i = 5;
  2660.       while(i > 0)
  2661.       {
  2662.          bestHand.push(this["hh" + i]);
  2663.          i--;
  2664.       }
  2665.       dval = getVal(bestHand[1]);
  2666.       handText = "HIGH CARD - " + dval;
  2667.       hc = hh5;
  2668.    }
  2669.    if(playerHand == 1)
  2670.    {
  2671.       a = 0;
  2672.       i = 1;
  2673.       while(i < 6)
  2674.       {
  2675.          if(eval("hh" + i) != thisPair0)
  2676.          {
  2677.             set("wom" + a,eval("hh" + i));
  2678.             a += 1;
  2679.          }
  2680.          i++;
  2681.       }
  2682.       bestHand.push(thisPair0);
  2683.       bestHand.push(wom2);
  2684.       bestHand.push(wom1);
  2685.       bestHand.push(wom0);
  2686.       bestHand.push(0);
  2687.       dval = getVal(bestHand[1]);
  2688.       handText = "Pair of  " + dval + "\'s";
  2689.       hc = wom2;
  2690.    }
  2691.    if(playerHand == 2)
  2692.    {
  2693.       i = 1;
  2694.       while(i < 6)
  2695.       {
  2696.          if(eval("hh" + i) != thisPair0 and eval("hh" + i) != thisPair1)
  2697.          {
  2698.             wom = eval("hh" + i);
  2699.          }
  2700.          i++;
  2701.       }
  2702.       if(thisPair0 > thisPair1)
  2703.       {
  2704.          bestHand.push(thisPair0);
  2705.          bestHand.push(thisPair1);
  2706.       }
  2707.       else
  2708.       {
  2709.          bestHand.push(thisPair1);
  2710.          bestHand.push(thisPair0);
  2711.          hc = thisPair1;
  2712.          thisPair1 = thisPair0;
  2713.          thisPair0 = hc;
  2714.       }
  2715.       bestHand.push(wom);
  2716.       bestHand.push(0);
  2717.       bestHand.push(0);
  2718.       dval = getVal(bestHand[1]);
  2719.       dval2 = getVal(bestHand[2]);
  2720.       handText = "Two Pair " + dval + "\'s & " + dval2 + "\'s";
  2721.       hc = wom;
  2722.    }
  2723.    if(playerHand == 3)
  2724.    {
  2725.       a = 0;
  2726.       i = 1;
  2727.       while(i < 6)
  2728.       {
  2729.          if(eval("hh" + i) != thisPair0)
  2730.          {
  2731.             set("wom" + a,eval("hh" + i));
  2732.             a += 1;
  2733.          }
  2734.          i++;
  2735.       }
  2736.       bestHand.push(thisPair0);
  2737.       bestHand.push(wom1);
  2738.       bestHand.push(wom0);
  2739.       bestHand.push(0);
  2740.       bestHand.push(0);
  2741.       dval = getVal(bestHand[1]);
  2742.       handText = "Three of a Kind  " + dval + "\'s";
  2743.       hc = wom1;
  2744.    }
  2745.    if(playerHand == 4)
  2746.    {
  2747.       if(hh5 == 14 && hh1 == 2)
  2748.       {
  2749.          bestHand.push(hh4);
  2750.       }
  2751.       else
  2752.       {
  2753.          bestHand.push(hh5);
  2754.       }
  2755.       bestHand.push(0);
  2756.       bestHand.push(0);
  2757.       bestHand.push(0);
  2758.       bestHand.push(0);
  2759.       dval = getVal(bestHand[1]);
  2760.       handText = dval + " High Straight";
  2761.       hc = hh5;
  2762.    }
  2763.    if(playerHand == 5)
  2764.    {
  2765.       i = 5;
  2766.       while(i > 0)
  2767.       {
  2768.          bestHand.push(this["hh" + i]);
  2769.          i--;
  2770.       }
  2771.       dval = getVal(bestHand[1]);
  2772.       handText = dval + " High Flush";
  2773.       hc = hh5;
  2774.    }
  2775.    if(playerHand == 6)
  2776.    {
  2777.       wom = 0;
  2778.       i = 1;
  2779.       while(i < 6)
  2780.       {
  2781.          if(eval("hh" + i) == thisPair0)
  2782.          {
  2783.             wom += 1;
  2784.          }
  2785.          i++;
  2786.       }
  2787.       if(wom == 3)
  2788.       {
  2789.          bestHand.push(thisPair0);
  2790.          bestHand.push(thisPair1);
  2791.          hc = thisPair0;
  2792.       }
  2793.       if(wom == 2)
  2794.       {
  2795.          bestHand.push(thisPair1);
  2796.          bestHand.push(thisPair0);
  2797.          hc = thisPair1;
  2798.          thisPair1 = thisPair0;
  2799.          thisPair0 = hc;
  2800.       }
  2801.       bestHand.push(0);
  2802.       bestHand.push(0);
  2803.       bestHand.push(0);
  2804.       dval = getVal(bestHand[1]);
  2805.       dval2 = getVal(bestHand[2]);
  2806.       handText = "Full House " + dval + "\'s over " + dval2 + "\'s";
  2807.    }
  2808.    if(playerHand == 7)
  2809.    {
  2810.       i = 1;
  2811.       while(i < 6)
  2812.       {
  2813.          if(eval("hh" + i) != thisPair0)
  2814.          {
  2815.             wom = eval("hh" + i);
  2816.          }
  2817.          i++;
  2818.       }
  2819.       bestHand.push(thisPair0);
  2820.       bestHand.push(wom);
  2821.       bestHand.push(0);
  2822.       bestHand.push(0);
  2823.       bestHand.push(0);
  2824.       dval = getVal(bestHand[1]);
  2825.       handText = "Four of a Kind " + dval + "\'s";
  2826.       hc = wom;
  2827.    }
  2828.    if(playerHand == 8)
  2829.    {
  2830.       if(hh5 == 14 && hh1 == 2)
  2831.       {
  2832.          bestHand.push(14);
  2833.       }
  2834.       else
  2835.       {
  2836.          bestHand.push(hh5);
  2837.       }
  2838.       bestHand.push(0);
  2839.       bestHand.push(0);
  2840.       bestHand.push(0);
  2841.       bestHand.push(0);
  2842.       dval = getVal(bestHand[1]);
  2843.       handText = "Straight Flush " + dval + " High";
  2844.       hc = hh5;
  2845.    }
  2846.    if(playerHand == 9)
  2847.    {
  2848.       bestHand.push(0);
  2849.       bestHand.push(0);
  2850.       bestHand.push(0);
  2851.       bestHand.push(0);
  2852.       bestHand.push(0);
  2853.       handText = "*** Royal Flush ***";
  2854.       hc = hh5;
  2855.    }
  2856. };
  2857. getVal = function(num)
  2858. {
  2859.    if(num == 11)
  2860.    {
  2861.       return "JACK";
  2862.    }
  2863.    if(num == 12)
  2864.    {
  2865.       return "QUEEN";
  2866.    }
  2867.    if(num == 13)
  2868.    {
  2869.       return "KING";
  2870.    }
  2871.    if(num == 14)
  2872.    {
  2873.       return "ACE";
  2874.    }
  2875.    if(num == 2)
  2876.    {
  2877.       return "2";
  2878.    }
  2879.    if(num == 3)
  2880.    {
  2881.       return "3";
  2882.    }
  2883.    if(num == 4)
  2884.    {
  2885.       return "4";
  2886.    }
  2887.    if(num == 5)
  2888.    {
  2889.       return "5";
  2890.    }
  2891.    if(num == 6)
  2892.    {
  2893.       return "6";
  2894.    }
  2895.    if(num == 7)
  2896.    {
  2897.       return "7";
  2898.    }
  2899.    if(num == 8)
  2900.    {
  2901.       return "8";
  2902.    }
  2903.    if(num == 9)
  2904.    {
  2905.       return "9";
  2906.    }
  2907.    if(num == 10)
  2908.    {
  2909.       return "10";
  2910.    }
  2911. };
  2912. ShockwaveHubDialog.prototype.Init = function()
  2913. {
  2914.    var _loc2_ = "http://www.shockwave.com/content/highscores/scorez-2002.swf";
  2915.    loadMovie(_loc2_,"_level2");
  2916.    this.fInterval = setInterval(this,"Timer",100);
  2917. };
  2918. ShockwaveHubDialog.prototype.End = function()
  2919. {
  2920.    if(this.fInterval != null)
  2921.    {
  2922.       clearInterval(this.fInterval);
  2923.       this.fInterval = null;
  2924.    }
  2925. };
  2926. ShockwaveHubDialog.prototype.Timer = function()
  2927. {
  2928.    if(_level2.getBytesTotal() >= 0)
  2929.    {
  2930.       clearInterval(this.fInterval);
  2931.       this.fInterval = null;
  2932.    }
  2933.    else
  2934.    {
  2935.       var _loc5_ = getTimer();
  2936.       if(_loc5_ - this.fStart < 30000)
  2937.       {
  2938.          var _loc3_ = "";
  2939.          var _loc4_ = int((_loc5_ - this.fStart) % 1000 / 200);
  2940.          var _loc2_ = 0;
  2941.          while(_loc2_ < _loc4_)
  2942.          {
  2943.             _loc3_ += ".";
  2944.             _loc2_ = _loc2_ + 1;
  2945.          }
  2946.          this.fClip.msg1.text = "contacting shockwave.com" + _loc3_;
  2947.          this.fClip.msg2.text = this.fClip.msg1.text;
  2948.       }
  2949.       else
  2950.       {
  2951.          if(!this.fbDidUnload)
  2952.          {
  2953.             this.fbDidUnload = true;
  2954.             _level2.unloadMovie();
  2955.          }
  2956.          this.fClip.msg1.text = "failed to contact shockwave.com";
  2957.          this.fClip.msg2.text = this.fClip.msg1.text;
  2958.          if(_loc5_ - this.fStart > 33000)
  2959.          {
  2960.             this.End();
  2961.          }
  2962.       }
  2963.    }
  2964. };
  2965. debug = false;
  2966. menudepth = 25;
  2967. tabledepth = 50;
  2968. rounddepth = 100;
  2969. allindepth = 125;
  2970. bubbledepth = 150;
  2971. tablemenudepth = 200;
  2972. pausedepth = 777;
  2973. pauseOn = false;
  2974. prePay = new Array();
  2975. prePay[0] = new Array(2000,1000,200);
  2976. prePay[1] = new Array(3000,1500,300);
  2977. prePay[2] = new Array(4000,2000,500);
  2978. prePay[3] = new Array(6000,3000,500);
  2979. prePay[4] = new Array(8000,4000,1000);
  2980. prePay[5] = new Array(12000,6000,1000);
  2981. prePay[6] = new Array(16000,8000,2000);
  2982. prePay[7] = new Array(20000,10000,2000);
  2983. prePay[8] = new Array(30000,15000,3000);
  2984. prePay[9] = new Array(30000,15000,3000);
  2985. prePay[10] = new Array(30000,15000,3000);
  2986. prePay[11] = new Array(30000,15000,3000);
  2987. prePay[12] = new Array(30000,15000,3000);
  2988. prePay[13] = new Array(30000,15000,3000);
  2989. prePay[14] = new Array(30000,15000,3000);
  2990. prePay[15] = new Array(30000,15000,3000);
  2991. loadAI();
  2992. betLevel = 0;
  2993. getBetLevel();
  2994. if(!maxplayers)
  2995. {
  2996.    maxplayers = 5;
  2997. }
  2998. maxplayers = 4;
  2999. maxraises = 3;
  3000. logobufferx = 0;
  3001. logobuffery = 0;
  3002. Game.prototype.introDialog = function()
  3003. {
  3004.    table.attachMovie("dialogRed","introDialog",this.mydepth++);
  3005.    table.introDialog.btn_play.btn.onRelease = function()
  3006.    {
  3007.       mygame.intro();
  3008.       table.introDialog.removeMovieClip();
  3009.    };
  3010.    table.introDialog.btn_play.btn.onPress = function()
  3011.    {
  3012.       _root.buttonSound();
  3013.    };
  3014. };
  3015. Game.prototype.intro = function()
  3016. {
  3017.    function introCallback()
  3018.    {
  3019.       if(pauseOn == false)
  3020.       {
  3021.          if(count < introOrder.length)
  3022.          {
  3023.             if(count == 0)
  3024.             {
  3025.                PlaySoundEffect("SOUND_CLAP4");
  3026.                table.attachMovie("infoBox","infoBox",_root.mygame.mydepth + 100);
  3027.                table.infoBox._x = 52;
  3028.                table.infoBox._y = 317;
  3029.             }
  3030.             _root.mygame.createPlayerBoxes(introOrder[count]);
  3031.          }
  3032.          else
  3033.          {
  3034.             _root.table.infoBox.removeMovieClip();
  3035.             _root.mygame.mybubble.killBubble();
  3036.          }
  3037.          count++;
  3038.          if(count > introOrder.length)
  3039.          {
  3040.             count = 0;
  3041.             introChips();
  3042.             clearInterval(intID0001);
  3043.          }
  3044.       }
  3045.    }
  3046.    function introChips()
  3047.    {
  3048.       function introChipsCallback()
  3049.       {
  3050.          PlaySoundEffect("SOUND_CHIP1");
  3051.          _root.mygame.createChips(introOrder[count]);
  3052.          count++;
  3053.          if(count >= introOrder.length)
  3054.          {
  3055.             _root.mygame.makeNewRound();
  3056.             clearInterval(intID0003);
  3057.          }
  3058.       }
  3059.       _root.gGameStartTime = getTimer();
  3060.       intID0003 = setInterval(introChipsCallback,300);
  3061.    }
  3062.    var introOrder;
  3063.    var count = 0;
  3064.    if(maxplayers == 5)
  3065.    {
  3066.       introOrder = new Array(4,0,1,2,3);
  3067.    }
  3068.    else
  3069.    {
  3070.       introOrder = new Array(4,0,1,3);
  3071.    }
  3072.    this.mybubble.makeBubble(5,"Please Welcome","Our Players",0);
  3073.    intID0001 = setInterval(introCallback,2100);
  3074. };
  3075. Game.prototype.createPlayerBoxes = function(who)
  3076. {
  3077.    function movePlayerBox(where)
  3078.    {
  3079.       PlaySoundEffect("SOUND_SPIN");
  3080.       var _loc3_ = _root.mygame.gPbox["b" + where].x;
  3081.       var _loc2_ = _root.mygame.gPbox["b" + where].y;
  3082.       _root.table["pBox" + where].goToPoint(_loc3_,_loc2_,5);
  3083.       clearInterval(intID0002);
  3084.    }
  3085.    PlaySoundEffect("SOUND_ATTENTION5");
  3086.    table.infoBox.myname.text = this.gPlayers["player" + who].first + " " + this.gPlayers["player" + who].last;
  3087.    table.infoBox.mytag.text = this.gPlayers["player" + who].lTag;
  3088.    table.attachMovie("playerBox","pBox" + who,this.mydepth++);
  3089.    table["pBox" + who]._x = 244.8;
  3090.    table["pBox" + who]._y = 118.3;
  3091.    table["pBox" + who]._xscale = 85;
  3092.    table["pBox" + who]._yscale = 85;
  3093.    table["pBox" + who].cover._visible = false;
  3094.    table["pBox" + who].highlite._visible = false;
  3095.    table["pBox" + who].statusBox._visible = false;
  3096.    table["pBox" + who].statusBox.display.text = "";
  3097.    table["pBox" + who].mybet = 0;
  3098.    table["pBox" + who].myname.text = this.gPlayers["player" + who].first;
  3099.    table["pBox" + who].mylastname = this.gPlayers["player" + who].last;
  3100.    if(who == 3)
  3101.    {
  3102.       table["pBox" + who].player.gotoAndStop("player");
  3103.    }
  3104.    else
  3105.    {
  3106.       table["pBox" + who].player.gotoAndStop(this.gPlayers["player" + who].first);
  3107.    }
  3108.    intID0002 = setInterval(movePlayerBox,1600,who);
  3109. };
  3110. Game.prototype.createChips = function(who)
  3111. {
  3112.    table.attachMovie("chipBox","chipBox" + who,this.mydepth++);
  3113.    table["chipBox" + who]._x = this.gPbox["b" + who].chipx;
  3114.    table["chipBox" + who]._y = this.gPbox["b" + who].chipy;
  3115.    table["chipBox" + who].mybalance = this.defaultBalance;
  3116.    table["chipBox" + who].balance.text = balanceFormat(table["chipBox" + who].mybalance,0,",");
  3117.    table["chipBox" + who].chipCount = new Object();
  3118.    table["chipBox" + who].chipCount = this.gChip.defaultChips;
  3119.    this.makeChipStacks(who);
  3120. };
  3121. Game.prototype.colorUpChips = function(who)
  3122. {
  3123.    var _loc3_ = new Array();
  3124.    _loc3_ = this.getP(who);
  3125.    if(_loc3_[4].amt > 0)
  3126.    {
  3127.       if(_loc3_[4].amt > 1 && _loc3_[3].amt < 5)
  3128.       {
  3129.          this.gChip["chip" + who].c100 += 10;
  3130.          this.gChip["chip" + who].c500 += 10;
  3131.          this.gChip["chip" + who].c1000 += 14;
  3132.          this.gChip["chip" + who].c5000 += 6;
  3133.          this.gChip["chip" + who].c25000 -= 2;
  3134.       }
  3135.       else
  3136.       {
  3137.          this.gChip["chip" + who].c100 += 10;
  3138.          this.gChip["chip" + who].c500 += 10;
  3139.          this.gChip["chip" + who].c1000 += 14;
  3140.          this.gChip["chip" + who].c5000 += 1;
  3141.          this.gChip["chip" + who].c25000 -= 1;
  3142.       }
  3143.    }
  3144.    this.clearChips(who);
  3145.    this.makeChipStacks(who);
  3146. };
  3147. Game.prototype.makeChipStacks = function(who)
  3148. {
  3149.    oflow = this.gChip.oflow;
  3150.    p = this.getP(who);
  3151.    checkAgain = true;
  3152.    while(checkAgain == true)
  3153.    {
  3154.       getStacks();
  3155.    }
  3156.    sortChips();
  3157.    var _loc2_ = 0;
  3158.    while(_loc2_ < 6)
  3159.    {
  3160.       this["stack" + _loc2_] = new Object();
  3161.       this["stack" + _loc2_].amt = p[0].amt;
  3162.       this["stack" + _loc2_].n = p[0].n;
  3163.       if(this["stack" + _loc2_].amt > oflow)
  3164.       {
  3165.          this["stack" + _loc2_].amt = oflow;
  3166.          p[0].amt -= oflow;
  3167.       }
  3168.       else
  3169.       {
  3170.          p[0].amt = 0;
  3171.       }
  3172.       sortChips();
  3173.       _loc2_ = _loc2_ + 1;
  3174.    }
  3175.    this.cdpth = 0;
  3176.    table["chipBox" + who].chipcount = 0;
  3177.    _loc2_ = 0;
  3178.    while(_loc2_ < 6)
  3179.    {
  3180.       var _loc4_ = 0;
  3181.       while(_loc4_ < this["stack" + _loc2_].amt)
  3182.       {
  3183.          table["chipBox" + who].attachMovie("chipmaster","chip" + this.cdpth,this.cdpth++);
  3184.          table["chipBox" + who]["chip" + this.cdpth]._x = this.gChip["chip" + _loc2_].x;
  3185.          table["chipBox" + who]["chip" + this.cdpth]._y = this.gChip["chip" + _loc2_].y - this.gChip.inc * _loc4_;
  3186.          table["chipBox" + who]["chip" + this.cdpth].gotoAndStop(this["stack" + _loc2_].n);
  3187.          table["chipBox" + who]["chip" + this.cdpth].myvalue = this["stack" + _loc2_].n;
  3188.          table["chipBox" + who].chipcount = table["chipBox" + who].chipcount + 1;
  3189.          _loc4_ = _loc4_ + 1;
  3190.       }
  3191.       _loc2_ = _loc2_ + 1;
  3192.    }
  3193. };
  3194. Game.prototype.addClickables = function(who)
  3195. {
  3196.    var _loc2_ = 0;
  3197.    while(_loc2_ < table["chipBox" + who].chipcount)
  3198.    {
  3199.       table["chipBox" + who]["chip" + _loc2_].iButton.gotoAndStop(2);
  3200.       table["chipBox" + who]["chip" + _loc2_].iButton.btn.onRelease = function()
  3201.       {
  3202.          str = this._parent._parent.myvalue;
  3203.          chipBoxIbutton(str);
  3204.          this._parent._parent.removeMovieClip();
  3205.       };
  3206.       _loc2_ = _loc2_ + 1;
  3207.    }
  3208. };
  3209. Game.prototype.clearChips = function(who)
  3210. {
  3211.    var _loc1_ = 0;
  3212.    while(_loc1_ < table["chipBox" + who].chipcount + 1)
  3213.    {
  3214.       table["chipBox" + who]["chip" + _loc1_].removeMovieClip();
  3215.       _loc1_ = _loc1_ + 1;
  3216.    }
  3217. };
  3218. Game.prototype.getP = function(who)
  3219. {
  3220.    anArray = new Array();
  3221.    anArray.push({n:"c100",amt:this.gChip["chip" + who].c100,tonext:5,toprev:0});
  3222.    anArray.push({n:"c500",amt:this.gChip["chip" + who].c500,tonext:2,toprev:5});
  3223.    anArray.push({n:"c1000",amt:this.gChip["chip" + who].c1000,tonext:5,toprev:2});
  3224.    anArray.push({n:"c5000",amt:this.gChip["chip" + who].c5000,tonext:5,toprev:5});
  3225.    anArray.push({n:"c25000",amt:this.gChip["chip" + who].c25000,tonext:0,toprev:5});
  3226.    return anArray;
  3227. };
  3228. Game.prototype.updateBalance = function(who, amt, type)
  3229. {
  3230.    function unconvertChip(chip, amt)
  3231.    {
  3232.       if(p[chip].amt < amt)
  3233.       {
  3234.          found = false;
  3235.          var _loc1_ = chip + 1;
  3236.          while(found == false)
  3237.          {
  3238.             if(p[_loc1_].amt > 0)
  3239.             {
  3240.                found = true;
  3241.             }
  3242.             else
  3243.             {
  3244.                _loc1_ = _loc1_ + 1;
  3245.             }
  3246.          }
  3247.          p[_loc1_].amt -= 1;
  3248.          p[_loc1_ - 1].amt += p[_loc1_].toprev;
  3249.          if(_loc1_ - 1 == chip)
  3250.          {
  3251.             mycontinue = false;
  3252.          }
  3253.          else
  3254.          {
  3255.             mycontinue = true;
  3256.          }
  3257.       }
  3258.       else
  3259.       {
  3260.          mycontinue = false;
  3261.       }
  3262.    }
  3263.    var _loc3_ = undefined;
  3264.    var _loc7_ = undefined;
  3265.    if(type == "pos")
  3266.    {
  3267.       table["chipBox" + who].mybalance += amt;
  3268.       table["chipBox" + who].enchilada += amt;
  3269.    }
  3270.    else
  3271.    {
  3272.       table["chipBox" + who].mybalance -= amt;
  3273.       table["chipBox" + who].enchilada -= amt;
  3274.    }
  3275.    table["chipBox" + who].balance.text = _root.balanceFormat(table["chipBox" + who].mybalance,0,",");
  3276.    ideal = idealChips(amt);
  3277.    if(table["chipBox" + who].mybalance > 0)
  3278.    {
  3279.       if(type == "pos")
  3280.       {
  3281.          this.gChip["chip" + who].c100 += ideal[0];
  3282.          this.gChip["chip" + who].c500 += ideal[1];
  3283.          this.gChip["chip" + who].c1000 += ideal[2];
  3284.          this.gChip["chip" + who].c5000 += ideal[3];
  3285.          this.gChip["chip" + who].c25000 += ideal[4];
  3286.       }
  3287.       else
  3288.       {
  3289.          p = mygame.getP(who);
  3290.          _loc7_ = mygame.getMyColor(who);
  3291.          if(amt > table["chipBox" + who].mybalance)
  3292.          {
  3293.             _loc7_ = true;
  3294.          }
  3295.          if(_loc7_ == false)
  3296.          {
  3297.             _loc3_ = 0;
  3298.             while(_loc3_ < ideal.length)
  3299.             {
  3300.                if(ideal[_loc3_] > 0)
  3301.                {
  3302.                   mycontinue = true;
  3303.                   while(mycontinue == true)
  3304.                   {
  3305.                      unconvertChip(_loc3_,ideal[_loc3_]);
  3306.                   }
  3307.                }
  3308.                p[_loc3_].amt -= ideal[_loc3_];
  3309.                _loc3_ = _loc3_ + 1;
  3310.             }
  3311.             this.gChip["chip" + who].c100 = p[0].amt;
  3312.             this.gChip["chip" + who].c500 = p[1].amt;
  3313.             this.gChip["chip" + who].c1000 = p[2].amt;
  3314.             this.gChip["chip" + who].c5000 = p[3].amt;
  3315.             this.gChip["chip" + who].c25000 = p[4].amt;
  3316.          }
  3317.          else
  3318.          {
  3319.             ideal = idealChips(table["chipBox" + who].mybalance);
  3320.             this.gChip["chip" + who].c100 = ideal[0];
  3321.             this.gChip["chip" + who].c500 = ideal[1];
  3322.             this.gChip["chip" + who].c1000 = ideal[2];
  3323.             this.gChip["chip" + who].c5000 = ideal[3];
  3324.             this.gChip["chip" + who].c25000 = ideal[4];
  3325.          }
  3326.       }
  3327.    }
  3328.    else
  3329.    {
  3330.       this.gChip["chip" + who].c100 = 0;
  3331.       this.gChip["chip" + who].c500 = 0;
  3332.       this.gChip["chip" + who].c1000 = 0;
  3333.       this.gChip["chip" + who].c5000 = 0;
  3334.       this.gChip["chip" + who].c25000 = 0;
  3335.    }
  3336.    this.clearChips(who);
  3337.    this.makeChipStacks(who);
  3338.    if(_loc7_ == true)
  3339.    {
  3340.       if(this.gChip["chip" + who].c25000 > 0 && (this.gChip["chip" + who].c5000 == 0 || this.gChip["chip" + who].c1000 == 0 || this.gChip["chip" + who].c500 == 0 || this.gChip["chip" + who].c100 == 0))
  3341.       {
  3342.          mygame.colorUpChips(who);
  3343.       }
  3344.    }
  3345. };
  3346. Game.prototype.getMyColor = function(who)
  3347. {
  3348.    var _loc1_ = false;
  3349.    i = 4;
  3350.    while(i > 0)
  3351.    {
  3352.       if(ideal[i] > 0 && p[i].amt < ideal[i])
  3353.       {
  3354.          _loc1_ = true;
  3355.          break;
  3356.       }
  3357.       if(_loc1_ == false && ideal[i] == 0 && p[i].amt > 0)
  3358.       {
  3359.          _loc1_ = false;
  3360.          break;
  3361.       }
  3362.       i--;
  3363.    }
  3364.    return _loc1_;
  3365. };
  3366. Game.prototype.addToPot = function(amt)
  3367. {
  3368.    var _loc2_ = undefined;
  3369.    ideal = idealChips(amt);
  3370.    this.gChip.chipD.c100 += ideal[0];
  3371.    this.gChip.chipD.c500 += ideal[1];
  3372.    this.gChip.chipD.c1000 += ideal[2];
  3373.    this.gChip.chipD.c5000 += ideal[3];
  3374.    this.gChip.chipD.c25000 += ideal[4];
  3375.    _loc2_ = 0;
  3376.    while(_loc2_ < arena.potBox.chipcount + 1)
  3377.    {
  3378.       arena.potBox["chip" + _loc2_].removeMovieClip();
  3379.       _loc2_ = _loc2_ + 1;
  3380.    }
  3381.    oflow = this.gChip.oflow;
  3382.    p = new Array();
  3383.    p.push({n:"c100",amt:this.gChip.chipD.c100,tonext:5,toprev:0});
  3384.    p.push({n:"c500",amt:this.gChip.chipD.c500,tonext:2,toprev:5});
  3385.    p.push({n:"c1000",amt:this.gChip.chipD.c1000,tonext:5,toprev:2});
  3386.    p.push({n:"c5000",amt:this.gChip.chipD.c5000,tonext:5,toprev:5});
  3387.    p.push({n:"c25000",amt:this.gChip.chipD.c25000,tonext:0,toprev:5});
  3388.    checkAgain = true;
  3389.    while(checkAgain == true)
  3390.    {
  3391.       getStacks(4);
  3392.    }
  3393.    sortChips();
  3394.    _loc2_ = 0;
  3395.    while(_loc2_ < 10)
  3396.    {
  3397.       this["stack" + _loc2_] = new Object();
  3398.       this["stack" + _loc2_].amt = p[0].amt;
  3399.       this["stack" + _loc2_].n = p[0].n;
  3400.       if(this["stack" + _loc2_].amt > oflow)
  3401.       {
  3402.          this["stack" + _loc2_].amt = oflow;
  3403.          p[0].amt -= oflow;
  3404.       }
  3405.       else
  3406.       {
  3407.          p[0].amt = 0;
  3408.       }
  3409.       sortChips();
  3410.       _loc2_ = _loc2_ + 1;
  3411.    }
  3412.    this.cdpth = 0;
  3413.    arena.potBox.chipcount = 0;
  3414.    _loc2_ = 0;
  3415.    while(_loc2_ < 6)
  3416.    {
  3417.       var _loc3_ = 0;
  3418.       while(_loc3_ < this["stack" + _loc2_].amt)
  3419.       {
  3420.          arena.potBox.attachMovie("chipmaster","chip" + this.cdpth,this.cdpth++);
  3421.          arena.potBox["chip" + this.cdpth]._x = this.gChip["mchip" + _loc2_].x;
  3422.          arena.potBox["chip" + this.cdpth]._y = this.gChip["mchip" + _loc2_].y - this.gChip.inc * _loc3_;
  3423.          arena.potBox["chip" + this.cdpth].gotoAndStop(this["stack" + _loc2_].n);
  3424.          arena.potBox.chipcount = arena.potBox.chipcount + 1;
  3425.          _loc3_ = _loc3_ + 1;
  3426.       }
  3427.       _loc2_ = _loc2_ + 1;
  3428.    }
  3429. };
  3430. Game.prototype.addToBetBox = function(amt)
  3431. {
  3432.    ideal = idealChips(amt);
  3433.    this.gChip.chipBet.c100 += ideal[0];
  3434.    this.gChip.chipBet.c500 += ideal[1];
  3435.    this.gChip.chipBet.c1000 += ideal[2];
  3436.    this.gChip.chipBet.c5000 += ideal[3];
  3437.    this.gChip.chipBet.c25000 += ideal[4];
  3438.    var _loc2_ = 0;
  3439.    while(_loc2_ < arena.betBox.chipcount + 1)
  3440.    {
  3441.       arena.betBox["chip" + _loc2_].removeMovieClip();
  3442.       _loc2_ = _loc2_ + 1;
  3443.    }
  3444.    oflow = this.gChip.oflow;
  3445.    p = new Array();
  3446.    p.push({n:"c100",amt:this.gChip.chipBet.c100,tonext:5,toprev:0});
  3447.    p.push({n:"c500",amt:this.gChip.chipBet.c500,tonext:2,toprev:5});
  3448.    p.push({n:"c1000",amt:this.gChip.chipBet.c1000,tonext:5,toprev:2});
  3449.    p.push({n:"c5000",amt:this.gChip.chipBet.c5000,tonext:5,toprev:5});
  3450.    p.push({n:"c25000",amt:this.gChip.chipBet.c25000,tonext:0,toprev:5});
  3451.    checkAgain = true;
  3452.    while(checkAgain == true)
  3453.    {
  3454.       getStacks();
  3455.    }
  3456.    sortChips();
  3457.    _loc2_ = 0;
  3458.    while(_loc2_ < 10)
  3459.    {
  3460.       this["stack" + _loc2_] = new Object();
  3461.       this["stack" + _loc2_].amt = p[0].amt;
  3462.       this["stack" + _loc2_].n = p[0].n;
  3463.       if(this["stack" + _loc2_].amt > oflow)
  3464.       {
  3465.          this["stack" + _loc2_].amt = oflow;
  3466.          p[0].amt -= oflow;
  3467.       }
  3468.       else
  3469.       {
  3470.          p[0].amt = 0;
  3471.       }
  3472.       sortChips();
  3473.       _loc2_ = _loc2_ + 1;
  3474.    }
  3475.    this.cdpth = 0;
  3476.    arena.betBox.chipcount = 0;
  3477.    _loc2_ = 0;
  3478.    while(_loc2_ < 6)
  3479.    {
  3480.       var _loc3_ = 0;
  3481.       while(_loc3_ < this["stack" + _loc2_].amt)
  3482.       {
  3483.          arena.betBox.attachMovie("chipmaster","chip" + this.cdpth,this.cdpth++);
  3484.          arena.betBox["chip" + this.cdpth]._x = this.gChip["bchip" + _loc2_].x;
  3485.          arena.betBox["chip" + this.cdpth]._y = this.gChip["bchip" + _loc2_].y - this.gChip.inc * _loc3_;
  3486.          arena.betBox["chip" + this.cdpth].gotoAndStop(this["stack" + _loc2_].n);
  3487.          arena.betBox["chip" + this.cdpth].myvalue = this["stack" + _loc2_].n;
  3488.          arena.betBox["chip" + this.cdpth].iButton.gotoAndStop(2);
  3489.          arena.betBox["chip" + this.cdpth].iButton.btn.onRelease = function()
  3490.          {
  3491.             str = this._parent._parent.myvalue;
  3492.             betBoxIbutton(str);
  3493.             if(ok == true)
  3494.             {
  3495.                this._parent._parent.removeMovieClip();
  3496.             }
  3497.          };
  3498.          arena.betBox.chipcount = arena.betBox.chipcount + 1;
  3499.          _loc3_ = _loc3_ + 1;
  3500.       }
  3501.       _loc2_ = _loc2_ + 1;
  3502.    }
  3503. };
  3504. Game.prototype.placeDealerButton = function(who)
  3505. {
  3506.    table.dealerButton._x = this.gPbox["b" + who].dbx;
  3507.    table.dealerButton._y = this.gPbox["b" + who].dby;
  3508. };
  3509. Game.prototype.moveDealerButton = function(who)
  3510. {
  3511.    var _loc4_ = this.gPbox["b" + who].dbx;
  3512.    var _loc3_ = this.gPbox["b" + who].dby;
  3513.    table.dealerButton._x = this.gPbox["b" + who].dbx;
  3514.    table.dealerButton._y = this.gPbox["b" + who].dby;
  3515. };
  3516. Game.prototype.nextDealer = function(slot)
  3517. {
  3518.    var _loc2_ = undefined;
  3519.    var _loc3_ = slot;
  3520.    var _loc4_ = true;
  3521.    while(this.currentPlayers[_loc2_] == "e" || _loc4_ == true)
  3522.    {
  3523.       _loc4_ = false;
  3524.       _loc2_ = _loc3_ + 1;
  3525.       if(_loc2_ == this.currentPlayers.length)
  3526.       {
  3527.          _loc2_ = 0;
  3528.       }
  3529.       if(this.currentPlayers[_loc2_] == "e")
  3530.       {
  3531.          _loc3_ = _loc3_ + 1;
  3532.          if(_loc3_ == this.currentPlayers.length)
  3533.          {
  3534.             _loc3_ = 0;
  3535.          }
  3536.       }
  3537.       if(_loc3_ == 25)
  3538.       {
  3539.          this.currentPlayers[_loc2_] = 4;
  3540.       }
  3541.    }
  3542.    return _loc2_;
  3543. };
  3544. Game.prototype.makeNewRound = function()
  3545. {
  3546.    mygame.myhand = new TheHand(this.dealer,this.currentPlayers,true);
  3547. };
  3548. Game.prototype.killPlayer = function(who)
  3549. {
  3550.    var _loc2_ = 0;
  3551.    while(_loc2_ < this.currentPlayers.length)
  3552.    {
  3553.       if(this.currentPlayers[_loc2_] == who)
  3554.       {
  3555.          this.currentPlayers.splice(_loc2_,1);
  3556.          break;
  3557.       }
  3558.       _loc2_ = _loc2_ + 1;
  3559.    }
  3560.    table["pBox" + who].removeMovieClip();
  3561.    table["chipBox" + who].removeMovieClip();
  3562. };
  3563. TheHand.prototype.makePot = function(type)
  3564. {
  3565.    if(!type)
  3566.    {
  3567.       arena.attachMovie("potBox","potBox",this.mydepth++);
  3568.       arena.potBox.bal = 0;
  3569.       arena.potBox.chipCount = 0;
  3570.       arena.potBox._x = mygame.gChip.chipD.x;
  3571.       arena.potBox._y = mygame.gChip.chipD.y;
  3572.    }
  3573.    else
  3574.    {
  3575.       arena.attachMovie("betBox","betBox",this.mydepth++);
  3576.       arena.betBox.bal = 0;
  3577.       arena.betBox.chipCount = 0;
  3578.       arena.betBox._x = mygame.gChip.chipBet.x;
  3579.       arena.betBox._y = mygame.gChip.chipBet.y;
  3580.       mygame.gChip.chipBet.c100 = 0;
  3581.       mygame.gChip.chipBet.c500 = 0;
  3582.       mygame.gChip.chipBet.c1000 = 0;
  3583.       mygame.gChip.chipBet.c5000 = 0;
  3584.       mygame.gChip.chipBet.c25000 = 0;
  3585.    }
  3586. };
  3587. TheHand.prototype.addToPot = function(amt, pot, addStore)
  3588. {
  3589.    if(!pot)
  3590.    {
  3591.       pot = 0;
  3592.    }
  3593.    if(!addStore)
  3594.    {
  3595.       this.potStore[pot] += amt;
  3596.       trace(this.potStore[pot]);
  3597.    }
  3598.    arena.potBox.bal += amt;
  3599.    arena.potBox.balance.text = _root.balanceFormat(arena.potBox.bal,0,",");
  3600.    mygame.addToPot(amt);
  3601. };
  3602. TheHand.prototype.createBet = function(callamountB)
  3603. {
  3604.    var _loc3_ = undefined;
  3605.    this.makePot("bet");
  3606.    callamount = callamountB;
  3607.    minRaise = bigblind;
  3608.    arena.betBox.callamt.text = _root.balanceFormat(callamount,0,",");
  3609.    amt = callamount + minRaise;
  3610.    this.addToBet(amt);
  3611.    arena.betBox.balance.text = _root.balanceFormat(arena.betBox.bal - callamount,0,",");
  3612.    mygame.updateBalance(3,amt);
  3613.    _loc3_ = 0;
  3614.    while(_loc3_ < arena.betBox.chipcount + 1)
  3615.    {
  3616.       arena.betBox["chip" + _loc3_].iButton.gotoAndStop(2);
  3617.       arena.betBox["chip" + _loc3_].iButton.btn.onRelease = function()
  3618.       {
  3619.          mygame.isNew = false;
  3620.          str = this._parent._parent.myvalue;
  3621.          betBoxIbutton(str);
  3622.          if(ok == true)
  3623.          {
  3624.             this._parent._parent.removeMovieClip();
  3625.          }
  3626.       };
  3627.       _loc3_ = _loc3_ + 1;
  3628.    }
  3629.    _loc3_ = 0;
  3630.    while(_loc3_ < table.chipBox3.chipcount + 1)
  3631.    {
  3632.       table.chipBox3["chip" + _loc3_].iButton.gotoAndStop(2);
  3633.       table.chipBox3["chip" + _loc3_].iButton.btn.onRelease = function()
  3634.       {
  3635.          mygame.isNew = false;
  3636.          str = this._parent._parent.myvalue;
  3637.          chipBoxIbutton(str);
  3638.          this._parent._parent.removeMovieClip();
  3639.       };
  3640.       _loc3_ = _loc3_ + 1;
  3641.    }
  3642. };
  3643. TheHand.prototype.addToBet = function(amt)
  3644. {
  3645.    arena.betBox.bal += amt;
  3646.    arena.betBox.balance.text = _root.balanceFormat(arena.betBox.bal,0,",");
  3647.    mygame.addToBetBox(amt);
  3648. };
  3649. TheHand.prototype.postAnte = function()
  3650. {
  3651.    mygame.mybubble.makeBubble(5,"Ante Up","blank",1,750);
  3652.    arena.ct = 0;
  3653.    trace("1  " + this.handPlayers[this.dealerSlot] + " ---  2  " + this.handPlayers);
  3654.    this.playOrder = this.getPlayOrder(this.handPlayers[this.dealerSlot],this.handPlayers);
  3655.    trace("POSTING ANTE  " + this.playOrder);
  3656.    intID0004 = setInterval(this.placeAnte,200);
  3657. };
  3658. TheHand.prototype.placeAnte = function()
  3659. {
  3660.    if(pauseOn == false)
  3661.    {
  3662.       PlaySoundEffect("SOUND_CHIP1");
  3663.       var _loc2_ = mygame.myhand.playOrder[arena.ct];
  3664.       table["pBox" + _loc2_].statusBox.display.text = "Ante " + _root.balanceFormat(mygame.ante,0,",");
  3665.       table["pBox" + _loc2_].statusBox._visible = true;
  3666.       table["pBox" + _loc2_].statusBox.colorBox.gotoAndStop(1);
  3667.       mygame.updateBalance(_loc2_,mygame.ante);
  3668.       mygame.myhand.addToPot(mygame.ante,0,true);
  3669.       mygame.myhand.basicPot += mygame.ante;
  3670.       arena.ct = arena.ct + 1;
  3671.       if(arena.ct >= mygame.myhand.playOrder.length)
  3672.       {
  3673.          mygame.myhand.postBlinds(mygame.myhand.handPlayers[mygame.myhand.dealerSlot]);
  3674.          clearInterval(intID0004);
  3675.       }
  3676.    }
  3677. };
  3678. TheHand.prototype.postBlinds = function(slot)
  3679. {
  3680.    function doPostBlinds()
  3681.    {
  3682.       if(pauseOn == false)
  3683.       {
  3684.          mygame.myhand.betStart = mygame.myhand.returnNextPlayer(mygame.myhand.betStart);
  3685.          PlaySoundEffect("SOUND_CHIP1");
  3686.          var _loc3_ = table["pBox" + mygame.myhand.playOrder[count]].myname.text;
  3687.          var _loc2_ = mygame.myhand.playOrder[count];
  3688.          trace("BLIND to " + _loc2_);
  3689.          if(count == 0)
  3690.          {
  3691.             mygame.mybubble.makeBubble(6,_loc3_ + " posts","the Small Blind",1,750);
  3692.             mygame.mybubble.makeBubble(mygame.myhand.playOrder[count],"posting " + _root.balanceFormat(mygame.smallblind,0,","),"blank",1,1250);
  3693.             table["pBox" + _loc2_].statusBox.display.text = "Posting " + _root.balanceFormat(mygame.smallblind,0,",");
  3694.             table["pBox" + _loc2_].statusBox.colorBox.gotoAndStop(3);
  3695.             mygame.updateBalance(_loc2_,mygame.smallblind);
  3696.             mygame.myhand.addToPot(mygame.smallblind,0);
  3697.             table["pBox" + _loc2_].mybet = mygame.smallblind;
  3698.          }
  3699.          else
  3700.          {
  3701.             mygame.mybubble.makeBubble(5,_loc3_ + " posts","the Big Blind",1,750);
  3702.             mygame.mybubble.makeBubble(mygame.myhand.playOrder[count],"posting " + _root.balanceFormat(mygame.bigblind,0,","),"blank",1,1250);
  3703.             table["pBox" + _loc2_].statusBox.display.text = "Posting " + _root.balanceFormat(mygame.bigblind,0,",");
  3704.             table["pBox" + _loc2_].statusBox.colorBox.gotoAndStop(3);
  3705.             mygame.updateBalance(_loc2_,mygame.bigblind);
  3706.             mygame.myhand.addToPot(mygame.bigblind,0);
  3707.             table["pBox" + _loc2_].mybet = mygame.bigblind;
  3708.             mygame.myhand.currentBet += mygame.bigblind;
  3709.             mygame.myhand.dealCards();
  3710.             clearInterval(intID0005);
  3711.          }
  3712.          count++;
  3713.       }
  3714.    }
  3715.    mygame.mybubble.makeBubble(5,table["pBox" + slot].myname.text,"is the Dealer",1,1250);
  3716.    count = 0;
  3717.    intID0005 = setInterval(doPostBlinds,1250);
  3718. };
  3719. TheHand.prototype.dealCards = function()
  3720. {
  3721.    trace("DEALING CARDS");
  3722.    this.deck = new Array();
  3723.    var _loc2_ = 1;
  3724.    while(_loc2_ < 53)
  3725.    {
  3726.       this.deck.push(_loc2_);
  3727.       _loc2_ = _loc2_ + 1;
  3728.    }
  3729.    this.deck.shuffle();
  3730.    if(debug == true)
  3731.    {
  3732.       this.deck[0] = 2;
  3733.       this.deck[1] = 15;
  3734.       this.deck[2] = 4;
  3735.       this.deck[3] = 17;
  3736.       this.deck[4] = 18;
  3737.       this.deck[5] = 31;
  3738.       this.deck[6] = 47;
  3739.       this.deck[7] = 48;
  3740.       this.deck[8] = 50;
  3741.    }
  3742.    cardcount = 0;
  3743.    intID0006 = setInterval(this.deliverCard,200);
  3744. };
  3745. TheHand.prototype.deliverCard = function()
  3746. {
  3747.    PlaySoundEffect("SOUND_DEAL2");
  3748.    if(cardcount < mygame.myhand.playOrder.length)
  3749.    {
  3750.       var _loc3_ = mygame.myhand.playOrder[cardcount];
  3751.       cc = 0;
  3752.    }
  3753.    else
  3754.    {
  3755.       var _loc6_ = cardcount - mygame.myhand.playOrder.length;
  3756.       _loc3_ = mygame.myhand.playOrder[_loc6_];
  3757.       cc = 1;
  3758.    }
  3759.    var _loc2_ = "card_" + _loc3_ + "_" + cc;
  3760.    arena.attachMovie("card",_loc2_,mygame.myhand.mydepth++);
  3761.    arena[_loc2_]._xscale = 75;
  3762.    arena[_loc2_]._yscale = 75;
  3763.    arena[_loc2_]._x = 220;
  3764.    arena[_loc2_]._y = 10;
  3765.    arena[_loc2_].mycard = mygame.myhand.deck[cardcount];
  3766.    arena[_loc2_].gotoAndStop(mygame.myhand.deck[cardcount]);
  3767.    if(_loc3_ == 3 || debug == true)
  3768.    {
  3769.       arena[_loc2_].cardback._visible = false;
  3770.    }
  3771.    var _loc5_ = _root.mygame.gPbox["b" + _loc3_].cx + 12 * cc;
  3772.    var _loc4_ = _root.mygame.gPbox["b" + _loc3_].cy + 3 * cc;
  3773.    arena[_loc2_].goToPoint(_loc5_,_loc4_,3);
  3774.    cardcount++;
  3775.    if(cardcount >= mygame.myhand.playOrder.length * 2)
  3776.    {
  3777.       mygame.myhand.getBigCards();
  3778.       clearInterval(intID0006);
  3779.    }
  3780. };
  3781. TheHand.prototype.getBigCards = function()
  3782. {
  3783.    function doSwap(t0, t1)
  3784.    {
  3785.       if(count == 0)
  3786.       {
  3787.          PlaySoundEffect("SOUND_SPIN");
  3788.          var _loc3_ = 240;
  3789.          var _loc2_ = 405;
  3790.          arena.card_3_0.goToPoint(_loc3_,_loc2_,3,true);
  3791.          _loc3_ = 240;
  3792.          _loc2_ = 405;
  3793.          arena.card_3_1.goToPoint(_loc3_,_loc2_,3,true);
  3794.       }
  3795.       else if(count == 1)
  3796.       {
  3797.          var _loc1_ = "card_3_0";
  3798.          arena.attachMovie("card",_loc1_,mygame.myhand.mydepth++);
  3799.          if(maxplayers == 5)
  3800.          {
  3801.             arena[_loc1_]._x = 295;
  3802.             arena[_loc1_]._y = 335;
  3803.          }
  3804.          else
  3805.          {
  3806.             arena[_loc1_]._x = 252;
  3807.             arena[_loc1_]._y = 354;
  3808.          }
  3809.          arena[_loc1_].mycard = t0;
  3810.          arena[_loc1_].gotoAndStop(t0);
  3811.          arena[_loc1_].cardback._visible = false;
  3812.          _loc1_ = "card_3_1";
  3813.          arena.attachMovie("card",_loc1_,mygame.myhand.mydepth++);
  3814.          if(maxplayers == 5)
  3815.          {
  3816.             arena[_loc1_]._x = 325;
  3817.             arena[_loc1_]._y = 340;
  3818.          }
  3819.          else
  3820.          {
  3821.             arena[_loc1_]._x = 282;
  3822.             arena[_loc1_]._y = 359;
  3823.          }
  3824.          arena[_loc1_].mycard = t1;
  3825.          arena[_loc1_].gotoAndStop(t1);
  3826.          arena[_loc1_].cardback._visible = false;
  3827.       }
  3828.       count++;
  3829.       if(count == 2)
  3830.       {
  3831.          mygame.myhand.startBetting();
  3832.          clearInterval(intID0007);
  3833.       }
  3834.    }
  3835.    count = 0;
  3836.    var _loc4_ = arena.card_3_0._currentframe;
  3837.    var _loc5_ = arena.card_3_1._currentframe;
  3838.    intID0007 = setInterval(doSwap,350,_loc4_,_loc5_);
  3839. };
  3840. TheHand.prototype.dealCommunityCards = function()
  3841. {
  3842.    function doComm()
  3843.    {
  3844.       PlaySoundEffect("SOUND_DEAL2");
  3845.       var _loc1_ = "card_comm_" + mygame.myhand.commcardcount;
  3846.       arena.attachMovie("card",_loc1_,mygame.myhand.mydepth++);
  3847.       arena[_loc1_]._xscale = 75;
  3848.       arena[_loc1_]._yscale = 75;
  3849.       arena[_loc1_]._x = 220;
  3850.       arena[_loc1_]._y = 10;
  3851.       arena[_loc1_].mycard = mygame.myhand.deck[cardcount];
  3852.       arena[_loc1_].gotoAndStop(mygame.myhand.deck[cardcount]);
  3853.       arena[_loc1_].cardback._visible = false;
  3854.       if(maxplayers == 5)
  3855.       {
  3856.          var _loc3_ = 140 + inc * toinc;
  3857.          var _loc2_ = 179;
  3858.       }
  3859.       else
  3860.       {
  3861.          _loc3_ = 175 + inc * toinc;
  3862.          _loc2_ = 175;
  3863.       }
  3864.       arena[_loc1_].goToPoint(_loc3_,_loc2_,3);
  3865.       toinc++;
  3866.       count++;
  3867.       cardcount++;
  3868.       mygame.myhand.commcardcount = mygame.myhand.commcardcount + 1;
  3869.       if(count >= num)
  3870.       {
  3871.          intID0010 = setInterval(endComm,1000);
  3872.          clearInterval(intID0008);
  3873.       }
  3874.    }
  3875.    function endComm()
  3876.    {
  3877.       mygame.myhand.keepBetting();
  3878.       clearInterval(intID0010);
  3879.    }
  3880.    inc = 50;
  3881.    if(this.dealType[0] == "flop")
  3882.    {
  3883.       num = 3;
  3884.       toinc = 0;
  3885.    }
  3886.    else if(this.dealType[0] == "turn")
  3887.    {
  3888.       num = 1;
  3889.       toinc = 3;
  3890.    }
  3891.    else if(this.dealType[0] == "river")
  3892.    {
  3893.       num = 1;
  3894.       toinc = 4;
  3895.    }
  3896.    mygame.mybubble.makeBubble(5,"The " + this.dealType[0],"blank",1,1000);
  3897.    this.dealType.splice(0,1);
  3898.    count = 0;
  3899.    intID0008 = setInterval(doComm,350);
  3900. };
  3901. TheHand.prototype.gotoPlayer = function()
  3902. {
  3903.    if(pauseOn == false)
  3904.    {
  3905.       if(this.AllInPool[this.betStart] <= 0)
  3906.       {
  3907.          var _loc2_ = table["pBox" + this.betStart].myname.text;
  3908.          mygame.mybubble.makeBubble(5,_loc2_ + "?","blank",1,0);
  3909.          table["pBox" + this.betStart].highlite._visible = true;
  3910.       }
  3911.       this.determineBetButtons(this.betStart);
  3912.    }
  3913.    else
  3914.    {
  3915.       pauseReturnAction = "gotoPlayer";
  3916.    }
  3917. };
  3918. TheHand.prototype.determineBetButtons = function(who)
  3919. {
  3920.    var _loc8_ = table["pBox" + who].mybet;
  3921.    var _loc6_ = false;
  3922.    _root.attachNOchips = false;
  3923.    var _loc5_ = false;
  3924.    var _loc9_ = new Array();
  3925.    _loc9_ = this.whosLeft();
  3926.    if(this.AllInActive == _loc9_.length - 1 && who == 3)
  3927.    {
  3928.       _loc5_ = true;
  3929.    }
  3930.    trace("ALLIN  = " + this.AllInActive);
  3931.    trace("PLAYERS LEFT = " + _loc9_);
  3932.    trace("PLAYERS LEFT len = " + _loc9_.length);
  3933.    trace("SPECAC = " + _loc5_);
  3934.    trace("CURRENT BET = " + this.currentBet);
  3935.    trace("PLAYER BET = " + _loc8_);
  3936.    if(this.AllInPool[who] > 0 && who != 3 && this.betStart != 3)
  3937.    {
  3938.       _loc5_ = true;
  3939.       this.betStart = this.returnNextPlayer(this.betStart);
  3940.       this.playOrder = this.getPlayOrder(this.betStart,this.handPlayers);
  3941.       this.gotoPlayer();
  3942.    }
  3943.    if(this.currentBet > 0 && _loc8_ >= this.currentBet && _loc5_ == true && who == 3)
  3944.    {
  3945.       _root.attachNOchips = true;
  3946.       this.attachBetButtons(who,"allin","","","","",cb,_root.attachNOchips);
  3947.    }
  3948.    if(this.currentBet > 0 && _loc8_ < this.currentBet && _loc5_ == true && who == 3)
  3949.    {
  3950.       _root.attachNOchips = true;
  3951.       this.attachBetButtons(who,"allin","fold","","","",cb,_root.attachNOchips);
  3952.    }
  3953.    if(this.currentBet + minRaise >= table["chipBox" + who].mybalance && _loc5_ == false)
  3954.    {
  3955.       _loc6_ = true;
  3956.       cb = this.currentBet;
  3957.       _root.attachNOchips = true;
  3958.       if(this.currentBet == 0)
  3959.       {
  3960.          this.attachBetButtons(who,"allin","check","fold","","",cb,_root.attachNOchips);
  3961.       }
  3962.       else
  3963.       {
  3964.          this.attachBetButtons(who,"allin","fold","","","",cb,_root.attachNOchips);
  3965.       }
  3966.    }
  3967.    if(this.currentBet == 0 && _loc6_ == false && _loc5_ == false)
  3968.    {
  3969.       _loc6_ = true;
  3970.       cb = this.currentBet;
  3971.       this.attachBetButtons(who,"allin","bet","check","","",cb,_root.attachNOchips);
  3972.    }
  3973.    if(this.currentBet > 0 && _loc8_ < this.currentBet && _loc6_ == false && _loc5_ == false)
  3974.    {
  3975.       _loc6_ = true;
  3976.       cb = this.currentBet - _loc8_;
  3977.       if(this.numRaises >= _root.maxraises)
  3978.       {
  3979.          if(this.AllInActive > true)
  3980.          {
  3981.             _root.attachNOchips = true;
  3982.             this.attachBetButtons(who,"allin","fold","","","",cb,_root.attachNOchips);
  3983.          }
  3984.          else
  3985.          {
  3986.             _root.attachNOchips = true;
  3987.             this.attachBetButtons(who,"call","fold","","","",cb,_root.attachNOchips);
  3988.          }
  3989.       }
  3990.       else
  3991.       {
  3992.          var _loc7_ = this.AllInActive;
  3993.          var _loc3_ = 0;
  3994.          while(_loc3_ < this.handPlayers.length)
  3995.          {
  3996.             if(this.handPlayers == "f" || this.handPlayers == "e")
  3997.             {
  3998.                _loc7_ = _loc7_ + 1;
  3999.             }
  4000.             _loc3_ = _loc3_ + 1;
  4001.          }
  4002.          if(_loc7_ >= 3)
  4003.          {
  4004.             _root.attachNOchips = true;
  4005.             this.attachBetButtons(who,"allin","fold","","","",cb,_root.attachNOchips);
  4006.          }
  4007.          else
  4008.          {
  4009.             this.attachBetButtons(who,"allin","raise","call","fold","",cb,_root.attachNOchips);
  4010.          }
  4011.       }
  4012.    }
  4013.    if(this.currentBet > 0 && _loc8_ == this.currentBet && _loc6_ == false && _loc5_ == false)
  4014.    {
  4015.       _loc6_ = true;
  4016.       cb = 0;
  4017.       this.attachBetButtons(who,"allin","raise","check","","",cb,_root.attachNOchips);
  4018.    }
  4019. };
  4020. TheHand.prototype.attachBetButtons = function(who, b0, b1, b2, b3, b4, cb, isChips)
  4021. {
  4022.    if(who == 3)
  4023.    {
  4024.       if(!isChips)
  4025.       {
  4026.          if(mygame.gChip.chip3.c25000 > 0 && (mygame.gChip.chip3.c5000 == 0 || mygame.gChip.chip3.c1000 == 0 || mygame.gChip.chip3.c500 == 0 || mygame.gChip.chip3.c100 == 0))
  4027.          {
  4028.             mygame.colorUpChips(3);
  4029.          }
  4030.          this.createBet(cb);
  4031.       }
  4032.       var myname = "";
  4033.       if(maxplayers == 5)
  4034.       {
  4035.          var inc = 27;
  4036.          var x = 175;
  4037.          var y = 258;
  4038.       }
  4039.       else
  4040.       {
  4041.          var inc = 23;
  4042.          var x = 265;
  4043.          var y = 260.4;
  4044.       }
  4045.       arena.attachMovie("chipclicktext","chipclicktext",mygame.myhand.mydepth++);
  4046.       if(mygame.isNew == true && (this.dealType[0] == "flop" || this.dealType[0] == "turn"))
  4047.       {
  4048.          arena.chipclicktext._visible = true;
  4049.       }
  4050.       else
  4051.       {
  4052.          arena.chipclicktext._visible = false;
  4053.       }
  4054.       arena.chipclicktext._x = 394;
  4055.       arena.chipclicktext._y = 163;
  4056.       var i = 0;
  4057.       while(i < 5)
  4058.       {
  4059.          var action = eval("b" + i);
  4060.          if(action != "")
  4061.          {
  4062.             myname = "bb_" + action;
  4063.             arena.attachMovie(myname,myname,mygame.myhand.mydepth++);
  4064.             arena[myname]._x = x;
  4065.             arena[myname]._y = y + i * inc;
  4066.             arena[myname].action = action;
  4067.             arena[myname].who = who;
  4068.             arena[myname].btn.onRelease = function()
  4069.             {
  4070.                mygame.myhand.doBetAction(this._parent.who,this._parent.action);
  4071.             };
  4072.             arena[myname].btn.onPress = function()
  4073.             {
  4074.                _root.buttonSound();
  4075.             };
  4076.          }
  4077.          i++;
  4078.       }
  4079.    }
  4080.    else
  4081.    {
  4082.       _root.initAI(who);
  4083.    }
  4084. };
  4085. TheHand.prototype.killBetButtons = function()
  4086. {
  4087.    arena.chipclicktext.removeMovieClip();
  4088.    arena.bb_allin.removeMovieClip();
  4089.    arena.bb_raise.removeMovieClip();
  4090.    arena.bb_bet.removeMovieClip();
  4091.    arena.bb_call.removeMovieClip();
  4092.    arena.bb_check.removeMovieClip();
  4093.    arena.bb_fold.removeMovieClip();
  4094. };
  4095. TheHand.prototype.doAIBetAction = function(who)
  4096. {
  4097.    faction = undefined;
  4098.    aibet = _level22.mybet;
  4099.    if(aibet + 2 + 3 != aibet + 5)
  4100.    {
  4101.       aibet = bigblind;
  4102.    }
  4103.    aiaction = _level22.myaction[0];
  4104.    if(aibet == table["chipBox" + who].mybalance && aiaction == "R")
  4105.    {
  4106.       faction = "allin";
  4107.    }
  4108.    if(aibet + this.currentBet >= table["chipBox" + who].mybalance - 10000 && aiaction == "R")
  4109.    {
  4110.       faction = "allin";
  4111.    }
  4112.    if(faction != "allin" && aiaction == "R")
  4113.    {
  4114.       if(mygame.myhand.numBettors == 0 && this.currentBet == 0)
  4115.       {
  4116.          faction = "bet";
  4117.       }
  4118.       else
  4119.       {
  4120.          faction = "raise";
  4121.       }
  4122.       if(faction == "raise" && this.numRaises >= _root.maxraises)
  4123.       {
  4124.          faction = "call";
  4125.       }
  4126.       if(mygame.myhand.AllInActive > 0)
  4127.       {
  4128.          faction = "allin";
  4129.       }
  4130.    }
  4131.    if(aiaction == "C" && this.currentBet >= table["chipBox" + who].mybalance)
  4132.    {
  4133.       faction = "allin";
  4134.    }
  4135.    if(aiaction == "C" && faction != "allin")
  4136.    {
  4137.       if(mygame.myhand.currentBet == 0 || mygame.myhand.dealType[0] == "flop" && mygame.myhand.currentBet == bigblind && table["pBox" + who].mybet == bigblind)
  4138.       {
  4139.          faction = "check";
  4140.       }
  4141.       else
  4142.       {
  4143.          faction = "call";
  4144.       }
  4145.       if(this.AllInActive > 0)
  4146.       {
  4147.          if(random(3) == 0 || table["pBox" + who].mybet > mygame.myhand.currentBet)
  4148.          {
  4149.             faction = "allin";
  4150.          }
  4151.          else
  4152.          {
  4153.             faction = "fold";
  4154.          }
  4155.       }
  4156.    }
  4157.    if(aiaction == "F")
  4158.    {
  4159.       faction = "fold";
  4160.    }
  4161.    if(botsDoAll == true)
  4162.    {
  4163.       faction = "allin";
  4164.    }
  4165.    if(doodyhead == true)
  4166.    {
  4167.       faction = "fold";
  4168.    }
  4169.    trace("AI RESULT = " + faction + " ---- " + aiaction);
  4170.    mygame.myhand.doBetAction(who,faction,aibet);
  4171. };
  4172. TheHand.prototype.doBetAction = function(who, action, aibet)
  4173. {
  4174.    var _loc14_ = undefined;
  4175.    mygame.mybubble.killBubble();
  4176.    if(who == 3)
  4177.    {
  4178.       this.killBetButtons();
  4179.    }
  4180.    table["pBox" + who].highlite._visible = false;
  4181.    switch(action)
  4182.    {
  4183.       case "allin":
  4184.          var _loc5_ = undefined;
  4185.          var _loc11_ = undefined;
  4186.          this.AllInActive = this.AllInActive + 1;
  4187.          if(table["pBox" + who].mybet > 0)
  4188.          {
  4189.             trace("AMT REMOVED FROM POT 0  " + table["pBox" + who].mybet);
  4190.             this.potStore[0] -= table["pBox" + who].mybet;
  4191.          }
  4192.          amountToCall = this.currentBet - table["pBox" + who].mybet;
  4193.          if(who == 3 && _root.attachNOchips == false)
  4194.          {
  4195.             var _loc12_ = arena.betBox.bal;
  4196.             mygame.updateBalance(who,_loc12_,"pos");
  4197.          }
  4198.          _loc5_ = table["chipBox" + who].mybalance;
  4199.          _loc11_ = _loc5_ + table["pBox" + who].mybet;
  4200.          this.AllInPool[who] = _loc11_;
  4201.          PlaySoundEffect("SOUND_CHIP3");
  4202.          PlaySoundEffect("SOUND_ALLIN");
  4203.          if(this.numBettors > 0)
  4204.          {
  4205.             this.numRaises = this.numRaises + 1;
  4206.          }
  4207.          this.numBettors = this.numBettors + 1;
  4208.          if(this.currentBet < _loc5_)
  4209.          {
  4210.             this.currentBet = _loc5_;
  4211.          }
  4212.          table["pBox" + who].mybet = _loc5_;
  4213.          mygame.mybubble.makeBubble(who,"All In ",_root.balanceFormat(_loc11_,0,","),3,1250);
  4214.          table["pBox" + who].statusBox.display.text = "All In " + _root.balanceFormat(_loc11_,0,",");
  4215.          table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
  4216.          mygame.updateBalance(who,_loc5_);
  4217.          table["chipBox" + who]._visible = false;
  4218.          if(this.AllInActive == 1)
  4219.          {
  4220.             this.potStore[1] = this.AllInPool[who];
  4221.             this.currentpot = 1;
  4222.             mygame.myhand.addToPot(_loc5_,0,true);
  4223.          }
  4224.          else if(this.AllInActive == 2)
  4225.          {
  4226.             var _loc9_ = true;
  4227.             if(this.currentpot == 1)
  4228.             {
  4229.                this.currentpot = 2;
  4230.                if(this.AllInPool[who] < this.potStore[1])
  4231.                {
  4232.                   _loc9_ = false;
  4233.                }
  4234.                if(_loc9_ == true)
  4235.                {
  4236.                   this.potStore[2] = this.AllInPool[who] - this.potStore[1];
  4237.                   this.potStore[1] *= 2;
  4238.                   this.currentpot = 2;
  4239.                   trace("BIGGER POT 1   = " + this.potStore[1]);
  4240.                   trace("POT 2   = " + this.potStore[2]);
  4241.                   trace("Aliin who   = " + this.AllInPool[who]);
  4242.                }
  4243.                else
  4244.                {
  4245.                   this.potStore[2] = this.potStore[1];
  4246.                   this.potStore[1] = this.AllInPool[who] * 2;
  4247.                   this.potStore[2] -= this.AllInPool[who];
  4248.                   trace("SMALL POT 1   = " + this.potStore[1]);
  4249.                   trace("POT 2   = " + this.potStore[2]);
  4250.                   trace("Aliin who   = " + this.AllInPool[who]);
  4251.                }
  4252.                trace("Currentpot = " + this.currentpot);
  4253.             }
  4254.             else if(this.currentpot == 2)
  4255.             {
  4256.                if(this.AllInPool[who] <= this.potStore[1] / 2)
  4257.                {
  4258.                   _loc9_ = false;
  4259.                }
  4260.                if(_loc9_ == false)
  4261.                {
  4262.                   this.potStore[3] = this.potStore[2];
  4263.                   this.potStore[2] = this.potStore[1];
  4264.                   this.potStore[1] = this.AllInPool[who] * 3;
  4265.                   this.potStore[2] -= this.AllInPool[who] * 2;
  4266.                }
  4267.                if(_loc9_ == true && this.AllInPool[who] < this.potStore[2] + this.potStore[1] / 2)
  4268.                {
  4269.                   this.potStore[3] = this.potStore[2];
  4270.                   this.potStore[2] = this.AllInPool[who] - this.potStore[1] / 2;
  4271.                   this.potStore[1] += this.potStore[1] / 2;
  4272.                   this.potStore[3] -= this.potStore[2];
  4273.                   this.potStore[2] += this.potStore[2];
  4274.                }
  4275.                else if(_loc9_ == true && this.AllInPool[who] >= this.potStore[2] + this.potStore[1] / 2)
  4276.                {
  4277.                   this.potStore[3] = this.AllInPool[who] - this.potStore[2] - this.potStore[1] / 2;
  4278.                   this.potStore[1] += this.potStore[1] / 2;
  4279.                   this.potStore[2] += this.potStore[2];
  4280.                }
  4281.                this.currentpot = 3;
  4282.             }
  4283.             mygame.myhand.addToPot(_loc5_,0,true);
  4284.          }
  4285.          else if(this.AllInActive == 3)
  4286.          {
  4287.             trace("Currentpot = " + this.currentpot);
  4288.             _loc9_ = true;
  4289.             if(this.currentpot == 2)
  4290.             {
  4291.                if(this.AllInPool[who] <= this.potStore[1] / 2)
  4292.                {
  4293.                   _loc9_ = false;
  4294.                }
  4295.                trace(_loc9_);
  4296.                trace(this.AllInPool[who]);
  4297.                trace(this.potStore[1]);
  4298.                trace(this.potStore[2]);
  4299.                trace("00000000000000000");
  4300.                if(_loc9_ == false)
  4301.                {
  4302.                   this.potStore[3] = this.potStore[2];
  4303.                   this.potStore[2] = this.potStore[1];
  4304.                   this.potStore[1] = this.AllInPool[who] * 3;
  4305.                   this.potStore[2] -= this.AllInPool[who] * 2;
  4306.                }
  4307.                if(_loc9_ == true && this.AllInPool[who] < this.potStore[2] + this.potStore[1] / 2)
  4308.                {
  4309.                   this.potStore[3] = this.potStore[2];
  4310.                   this.potStore[2] = this.AllInPool[who] - this.potStore[1] / 2;
  4311.                   this.potStore[1] += this.potStore[1] / 2;
  4312.                   this.potStore[3] -= this.potStore[2];
  4313.                   this.potStore[2] += this.potStore[2];
  4314.                }
  4315.                else if(_loc9_ == true && this.AllInPool[who] >= this.potStore[2] + this.potStore[1] / 2)
  4316.                {
  4317.                   this.potStore[3] = this.AllInPool[who] - this.potStore[2] - this.potStore[1] / 2;
  4318.                   this.potStore[1] += this.potStore[1] / 2;
  4319.                   this.potStore[2] += this.potStore[2];
  4320.                }
  4321.                this.currentpot = 3;
  4322.             }
  4323.             else if(this.currentpot == 3)
  4324.             {
  4325.                if(this.AllInPool[who] < this.potStore[1] / 3)
  4326.                {
  4327.                   _loc9_ = false;
  4328.                }
  4329.                if(_loc9_ == false)
  4330.                {
  4331.                   this.potStore[3] = this.potStore[2];
  4332.                   this.potStore[2] = this.potStore[1];
  4333.                   this.potStore[1] = this.AllInPool[who] * 4;
  4334.                   this.potStore[2] -= this.AllInPool[who] * 3;
  4335.                }
  4336.                if(_loc9_ == true && this.AllInPool[who] < this.potStore[2] + this.potStore[1] / 3)
  4337.                {
  4338.                   this.potStore[3] = this.potStore[2];
  4339.                   this.potStore[2] = this.AllInPool[who] - this.potStore[1] / 3;
  4340.                   this.potStore[1] += this.potStore[1] / 3;
  4341.                   this.potStore[3] -= this.potStore[2] * 2;
  4342.                   this.potStore[2] *= 2;
  4343.                   _loc9_ = false;
  4344.                }
  4345.                else if(_loc9_ == true && this.AllInPool[who] < this.potStore[3] + this.potStore[2] / 2 + this.potStore[1] / 3)
  4346.                {
  4347.                   this.potStore[3] = this.potStore[2];
  4348.                   this.potStore[2] += this.potStore[2] / 2;
  4349.                   this.potStore[1] += this.potStore[1] / 3;
  4350.                   this.potStore[3] = this.AllInPool[who] - this.potStore[1] / 3 - this.potStore[2] / 2;
  4351.                   this.potStore[3] += this.potStore[3];
  4352.                   _loc9_ = false;
  4353.                }
  4354.                else if(_loc9_ == true && this.AllInPool[who] >= this.potStore[3] + this.potStore[2] / 2 + this.potStore[1] / 3)
  4355.                {
  4356.                   this.potStore[3] += this.potStore[3];
  4357.                   this.potStore[1] += this.potStore[1] / 3;
  4358.                   this.potStore[2] += this.potStore[2] / 2;
  4359.                }
  4360.                this.currentpot = 3;
  4361.             }
  4362.             mygame.myhand.addToPot(_loc5_,0,true);
  4363.          }
  4364.          else if(this.AllInActive == 4)
  4365.          {
  4366.             _loc9_ = true;
  4367.             if(this.AllInPool[who] <= this.potStore[1] / 3)
  4368.             {
  4369.                _loc9_ = false;
  4370.             }
  4371.             if(_loc9_ == false)
  4372.             {
  4373.                trace("opt1");
  4374.                this.potStore[4] = this.potStore[3];
  4375.                this.potStore[3] = this.potStore[2];
  4376.                this.potStore[2] = this.potStore[1];
  4377.                this.potStore[1] = this.AllInPool[who] * 4;
  4378.                this.potStore[2] -= this.AllInPool[who] * 3;
  4379.             }
  4380.             if(_loc9_ == true && this.AllInPool[who] < this.potStore[2] / 2 + this.potStore[1] / 3)
  4381.             {
  4382.                trace("opt2");
  4383.                this.potStore[4] = this.potStore[3];
  4384.                this.potStore[3] = this.potStore[2];
  4385.                this.potStore[2] = this.AllInPool[who] - this.potStore[1] / 3;
  4386.                this.potStore[1] += this.potStore[1] / 3;
  4387.                this.potStore[3] -= this.potStore[2] * 2;
  4388.                this.potStore[2] *= 2;
  4389.                _loc9_ = false;
  4390.             }
  4391.             else if(_loc9_ == true && this.AllInPool[who] < this.potStore[3] + this.potStore[2] / 2 + this.potStore[1] / 3)
  4392.             {
  4393.                trace("opt3");
  4394.                this.potStore[4] = this.potStore[3];
  4395.                this.potStore[3] = this.AllInPool[who] - this.potStore[1] / 3 - this.potStore[2] / 2;
  4396.                this.potStore[2] += this.potStore[2] / 2;
  4397.                this.potStore[1] += this.potStore[1] / 3;
  4398.                this.potStore[4] -= this.potStore[3] * 2;
  4399.                this.potStore[3] *= 2;
  4400.                _loc9_ = false;
  4401.             }
  4402.             else if(_loc9_ == true && this.AllInPool[who] >= this.potStore[3] + this.potStore[2] / 2 + this.potStore[1] / 3)
  4403.             {
  4404.                trace("opt4");
  4405.                this.potStore[4] = this.AllInPool[who] - this.potStore[1] / 3 - this.potStore[2] / 2 - this.potStore[3];
  4406.                this.potStore[3] += this.potStore[3];
  4407.                this.potStore[1] += this.potStore[1] / 3;
  4408.                this.potStore[2] += this.potStore[2] / 2;
  4409.             }
  4410.             this.currentpot = 3;
  4411.             mygame.myhand.addToPot(_loc5_,0,true);
  4412.          }
  4413.          trace("POTS ALERT *************");
  4414.          trace(this.potStore[0]);
  4415.          trace(this.potStore[1]);
  4416.          trace(this.potStore[2]);
  4417.          trace(this.potStore[3]);
  4418.          trace(this.potStore[4]);
  4419.          trace("POTS ALERT *************");
  4420.          break;
  4421.       case "raise":
  4422.          var _loc6_ = undefined;
  4423.          var amountToCall;
  4424.          amountToCall = this.currentBet - table["pBox" + who].mybet;
  4425.          if(who == 3)
  4426.          {
  4427.             _loc6_ = arena.betBox.bal - amountToCall;
  4428.          }
  4429.          else
  4430.          {
  4431.             _loc6_ = aibet;
  4432.          }
  4433.          _loc11_ = _loc6_ + amountToCall;
  4434.          if(this.numBettors > 0)
  4435.          {
  4436.             this.numRaises = this.numRaises + 1;
  4437.          }
  4438.          this.numBettors = this.numBettors + 1;
  4439.          this.currentBet += _loc6_;
  4440.          table["pBox" + who].mybet += _loc11_;
  4441.          PlaySoundEffect("SOUND_CHIP2");
  4442.          if(amountToCall > 0)
  4443.          {
  4444.             mygame.mybubble.makeBubble(who,"I Call " + _root.balanceFormat(amountToCall,0,","),"& Raise " + _root.balanceFormat(_loc6_,0,","),3,1250);
  4445.          }
  4446.          else
  4447.          {
  4448.             mygame.mybubble.makeBubble(who,"I Raise " + _root.balanceFormat(_loc6_,0,","),"blank",3,1250);
  4449.          }
  4450.          table["pBox" + who].statusBox.display.text = "Raise " + _root.balanceFormat(_loc6_,0,",");
  4451.          table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
  4452.          if(who != 3)
  4453.          {
  4454.             mygame.updateBalance(who,_loc11_);
  4455.          }
  4456.          if(this.AllInActive == 1)
  4457.          {
  4458.             this.potStore[1] += amountToCall;
  4459.             this.potStore[2] = _loc6_;
  4460.             this.currentpot = 2;
  4461.             yup = true;
  4462.          }
  4463.          if(this.AllInActive == 2)
  4464.          {
  4465.             this.potStore[2] = amountToCall - this.potStore[1] / 2;
  4466.             this.potStore[1] += this.potStore[1] / 2;
  4467.             this.potStore[3] = _loc6_;
  4468.             this.currentpot = 3;
  4469.             yup = true;
  4470.          }
  4471.          if(this.AllInActive == 0)
  4472.          {
  4473.             mygame.myhand.addToPot(_loc11_,0);
  4474.          }
  4475.          else
  4476.          {
  4477.             mygame.myhand.addToPot(_loc11_,0,true);
  4478.          }
  4479.          break;
  4480.       case "bet":
  4481.          var _loc4_ = undefined;
  4482.          if(who == 3)
  4483.          {
  4484.             _loc4_ = arena.betBox.bal;
  4485.          }
  4486.          else
  4487.          {
  4488.             _loc4_ = aibet;
  4489.          }
  4490.          this.numBettors = this.numBettors + 1;
  4491.          PlaySoundEffect("SOUND_CHIP2");
  4492.          this.currentBet = _loc4_;
  4493.          table["pBox" + who].mybet = _loc4_;
  4494.          mygame.mybubble.makeBubble(who,"I Bet ",_root.balanceFormat(_loc4_,0,","),3,1250);
  4495.          table["pBox" + who].statusBox.display.text = "Bet " + _root.balanceFormat(_loc4_,0,",");
  4496.          table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
  4497.          if(who != 3)
  4498.          {
  4499.             mygame.updateBalance(who,_loc4_);
  4500.          }
  4501.          mygame.myhand.addToPot(_loc4_);
  4502.          break;
  4503.       case "call":
  4504.          _loc4_ = this.currentBet - table["pBox" + who].mybet;
  4505.          PlaySoundEffect("SOUND_CHIP2");
  4506.          table["pBox" + who].mybet += _loc4_;
  4507.          mygame.mybubble.makeBubble(who,"I Call " + _root.balanceFormat(_loc4_,0,","),"blank",2,1250);
  4508.          table["pBox" + who].statusBox.display.text = "Call " + _root.balanceFormat(_loc4_,0,",");
  4509.          table["pBox" + who].statusBox.colorBox.gotoAndStop(2);
  4510.          if(who == 3 && _root.attachNOchips == false)
  4511.          {
  4512.             _loc12_ = arena.betBox.bal - _loc4_;
  4513.             trace(" ");
  4514.             trace(" ");
  4515.             trace("ADDING BACK TO MY BALANCE " + _loc12_);
  4516.             trace(" ");
  4517.             trace(" ");
  4518.             mygame.updateBalance(who,_loc12_,"pos");
  4519.          }
  4520.          else
  4521.          {
  4522.             mygame.updateBalance(who,_loc4_);
  4523.          }
  4524.          if(this.AllInActive == 1)
  4525.          {
  4526.             this.potStore[1] += _loc4_;
  4527.             yup = true;
  4528.          }
  4529.          if(this.AllInActive == 2)
  4530.          {
  4531.             this.potStore[2] = _loc4_ - this.potStore[1] / 2;
  4532.             this.potStore[1] += this.potStore[1] / 2;
  4533.             this.currentpot = 3;
  4534.             yup = true;
  4535.          }
  4536.          if(this.AllInActive == 0)
  4537.          {
  4538.             mygame.myhand.addToPot(_loc4_,0);
  4539.          }
  4540.          else
  4541.          {
  4542.             mygame.myhand.addToPot(_loc4_,0,true);
  4543.          }
  4544.          break;
  4545.       case "check":
  4546.          mygame.mybubble.makeBubble(who,"Check","blank",2,1250);
  4547.          table["pBox" + who].statusBox.display.text = "Check";
  4548.          table["pBox" + who].statusBox.colorBox.gotoAndStop(2);
  4549.          if(who == 3)
  4550.          {
  4551.             _loc12_ = arena.betBox.bal;
  4552.             mygame.updateBalance(who,_loc12_,"pos");
  4553.          }
  4554.          break;
  4555.       case "fold":
  4556.          this.AllInPool[who] = 0;
  4557.          PlaySoundEffect("SOUND_SPIN");
  4558.          arena["card_" + who + "_0"]._visible = false;
  4559.          arena["card_" + who + "_1"]._visible = false;
  4560.          this.handPlayers[who] = "f";
  4561.          table["pBox" + who].statusBox.display.text = "Folded";
  4562.          table["pBox" + who].statusBox.colorBox.gotoAndStop(4);
  4563.          if(who == 3 && _root.attachNOchips == false)
  4564.          {
  4565.             _loc12_ = arena.betBox.bal;
  4566.             mygame.updateBalance(who,_loc12_,"pos");
  4567.          }
  4568.          table["pBox" + who].cover._visible = true;
  4569.    }
  4570.    if(who == 3)
  4571.    {
  4572.       arena.betBox.removeMovieClip();
  4573.       ii = 0;
  4574.       while(ii < table.chipBox3.chipcount + 1)
  4575.       {
  4576.          table["chipBox" + who]["chip" + ii].iButton.gotoAndStop(1);
  4577.          ii++;
  4578.       }
  4579.    }
  4580.    var _loc10_ = false;
  4581.    var ii;
  4582.    if(action == "call" || action == "fold" || action == "check")
  4583.    {
  4584.       if(this.betStart == this.betStop)
  4585.       {
  4586.          _loc10_ = true;
  4587.       }
  4588.       else
  4589.       {
  4590.          this.betStart = this.returnNextPlayer(this.betStart);
  4591.       }
  4592.    }
  4593.    if(action == "raise" || action == "bet")
  4594.    {
  4595.       this.betStop = this.returnNextPlayer(this.betStart,"negative");
  4596.       this.betStart = this.returnNextPlayer(this.betStart);
  4597.       this.playOrder = this.getPlayOrder(this.betStart,this.handPlayers);
  4598.    }
  4599.    if(this.AllInActive > 0 && (action == "call" || action == "raise") && who == 3)
  4600.    {
  4601.       _loc10_ = false;
  4602.       this.betStop = 3;
  4603.    }
  4604.    else if(action == "allin")
  4605.    {
  4606.       trace(this.AllInActive + " --- allinactive");
  4607.       if(this.AllInActive < 2)
  4608.       {
  4609.          this.betStop = this.returnNextPlayer(this.betStart,"negative");
  4610.          this.betStart = this.returnNextPlayer(this.betStart);
  4611.          this.playOrder = this.getPlayOrder(this.betStart,this.handPlayers);
  4612.       }
  4613.       else if(this.betStart == this.betStop)
  4614.       {
  4615.          _loc10_ = true;
  4616.       }
  4617.       else
  4618.       {
  4619.          this.betStart = this.returnNextPlayer(this.betStart);
  4620.          this.playOrder = this.getPlayOrder(this.betStart,this.handPlayers);
  4621.       }
  4622.    }
  4623.    var _loc7_ = 0;
  4624.    ii = 0;
  4625.    while(ii < this.handPlayers.length)
  4626.    {
  4627.       if(this.handPlayers[ii] == "f" || this.handPlayers[ii] == "e")
  4628.       {
  4629.          _loc7_ = _loc7_ + 1;
  4630.       }
  4631.       ii++;
  4632.    }
  4633.    if(_loc7_ >= 4)
  4634.    {
  4635.       _loc10_ = true;
  4636.    }
  4637.    trace("BET START    " + mygame.myhand.betStart);
  4638.    trace("BET STOP    " + mygame.myhand.betStop);
  4639.    trace("PLAY ORDER    " + this.playOrder + "\n");
  4640.    if(_loc10_ == false)
  4641.    {
  4642.       this.gotoPlayer();
  4643.    }
  4644.    else
  4645.    {
  4646.       this.checkRoundStatus();
  4647.    }
  4648. };
  4649. TheHand.prototype.checkRoundStatus = function()
  4650. {
  4651.    function doComm2()
  4652.    {
  4653.       mygame.myhand.dealCommunityCards();
  4654.       clearInterval(intID0009);
  4655.    }
  4656.    trace("checking round status");
  4657.    var _loc4_ = 0;
  4658.    var _loc6_ = undefined;
  4659.    var _loc3_ = 0;
  4660.    while(_loc3_ < this.handPlayers.length)
  4661.    {
  4662.       if(this.handPlayers[_loc3_] != "f" && this.handPlayers[_loc3_] != "e")
  4663.       {
  4664.          table["pBox" + this.handPlayers[_loc3_]].mybet = 0;
  4665.          _loc4_ = _loc4_ + 1;
  4666.       }
  4667.       _loc3_ = _loc3_ + 1;
  4668.    }
  4669.    if(this.AllInActive > 1)
  4670.    {
  4671.       _loc4_ = 0;
  4672.    }
  4673.    if(_loc4_ >= 2 && this.dealType[0] != "end")
  4674.    {
  4675.       _loc6_ = 1500;
  4676.       if(this.handPlayers[3] == "f")
  4677.       {
  4678.          _loc6_ = 500;
  4679.       }
  4680.       intID0009 = setInterval(doComm2,_loc6_);
  4681.    }
  4682.    else
  4683.    {
  4684.       trace("GETTING WINNER");
  4685.       var _loc5_ = this.whosLeft();
  4686.       if(_loc4_ == 1)
  4687.       {
  4688.          processHand(_loc5_[0]);
  4689.          getWinner(_loc5_);
  4690.       }
  4691.       else
  4692.       {
  4693.          _root.attachMovie("runner","runner",1501);
  4694.       }
  4695.    }
  4696. };
  4697. TheHand.prototype.whosLeft = function()
  4698. {
  4699.    var _loc3_ = new Array();
  4700.    var _loc2_ = 0;
  4701.    while(_loc2_ < this.handPlayers.length)
  4702.    {
  4703.       if(this.handPlayers[_loc2_] != "f" && this.handPlayers[_loc2_] != "e")
  4704.       {
  4705.          _loc3_.push(_loc2_);
  4706.       }
  4707.       _loc2_ = _loc2_ + 1;
  4708.    }
  4709.    return _loc3_;
  4710. };
  4711. TheHand.prototype.startBetting = function()
  4712. {
  4713.    this.numBettors = 0;
  4714.    this.numRaises = 0;
  4715.    this.betStop = this.returnNextPlayer(this.dealerSlot);
  4716.    this.betStop = this.returnNextPlayer(this.betStop);
  4717.    this.playOrder = this.getPlayOrder(this.betStop,this.handPlayers);
  4718.    trace("BET START    " + mygame.myhand.betStart);
  4719.    trace("BET STOP    " + mygame.myhand.betStop);
  4720.    trace("PLAY ORDER    " + this.playOrder + "\n");
  4721.    this.gotoPlayer();
  4722. };
  4723. TheHand.prototype.keepBetting = function()
  4724. {
  4725.    this.numBettors = 0;
  4726.    this.numRaises = 0;
  4727.    this.currentBet = 0;
  4728.    this.betStart = this.returnNextPlayer(this.dealerSlot);
  4729.    if(this.handPlayers[this.dealerSlot] != "e" && this.handPlayers[this.dealerSlot] != "f")
  4730.    {
  4731.       this.betStop = this.dealerSlot;
  4732.    }
  4733.    else
  4734.    {
  4735.       this.betStop = this.returnNextPlayer(this.dealerSlot,"negative");
  4736.    }
  4737.    this.playOrder = this.getPlayOrder(this.betStart,this.handPlayers);
  4738.    trace("BET START    " + mygame.myhand.betStart);
  4739.    trace("BET STOP    " + mygame.myhand.betStop);
  4740.    trace("PLAY ORDER    " + this.playOrder + "\n");
  4741.    this.gotoPlayer();
  4742. };
  4743. TheHand.prototype.returnNextPlayer = function(slot, type)
  4744. {
  4745.    var _loc2_ = undefined;
  4746.    var _loc3_ = slot;
  4747.    var _loc4_ = true;
  4748.    while(this.handPlayers[_loc2_] == "f" || _loc4_ == true || this.handPlayers[_loc2_] == "e")
  4749.    {
  4750.       _loc4_ = false;
  4751.       if(type != "negative")
  4752.       {
  4753.          _loc2_ = _loc3_ + 1;
  4754.          if(_loc2_ == this.handPlayers.length)
  4755.          {
  4756.             _loc2_ = 0;
  4757.          }
  4758.          if(this.handPlayers[_loc2_] == "f" || this.handPlayers[_loc2_] == "e")
  4759.          {
  4760.             _loc3_ = _loc3_ + 1;
  4761.             if(_loc3_ == this.handPlayers.length)
  4762.             {
  4763.                _loc3_ = 0;
  4764.             }
  4765.          }
  4766.       }
  4767.       else
  4768.       {
  4769.          _loc2_ = _loc3_ - 1;
  4770.          if(_loc2_ < 0)
  4771.          {
  4772.             _loc2_ = this.handPlayers.length - 1;
  4773.          }
  4774.          if(this.handPlayers[_loc2_] == "f" || this.handPlayers[_loc2_] == "e")
  4775.          {
  4776.             _loc3_ = _loc3_ - 1;
  4777.             if(_loc3_ < 0)
  4778.             {
  4779.                _loc3_ = this.handPlayers.length;
  4780.             }
  4781.          }
  4782.       }
  4783.       if(_loc3_ == 25 || _loc3_ < -25)
  4784.       {
  4785.          this.handPlayers[_loc2_] = 4;
  4786.       }
  4787.    }
  4788.    return _loc2_;
  4789. };
  4790. TheHand.prototype.getPlayOrder = function(d, hp)
  4791. {
  4792.    var _loc6_ = new Array();
  4793.    var _loc3_ = 0;
  4794.    var _loc5_ = undefined;
  4795.    _loc5_ = d + 1;
  4796.    if(_loc5_ == 5)
  4797.    {
  4798.       _loc5_ = 0;
  4799.    }
  4800.    if(hp[_loc5_] == "e" || hp[_loc5_] == "f")
  4801.    {
  4802.       _loc5_ = this.gpoFix(_loc5_,hp);
  4803.    }
  4804.    var _loc4_ = 0;
  4805.    while(_loc4_ < hp.length)
  4806.    {
  4807.       if(hp[_loc5_] == hp[_loc4_])
  4808.       {
  4809.          _loc3_ = _loc4_;
  4810.          break;
  4811.       }
  4812.       _loc4_ = _loc4_ + 1;
  4813.    }
  4814.    if(_loc3_ >= hp.length)
  4815.    {
  4816.       _loc3_ = 0;
  4817.    }
  4818.    _loc4_ = 0;
  4819.    while(_loc4_ < hp.length)
  4820.    {
  4821.       if(hp[_loc3_] != "f" && hp[_loc3_] != "e")
  4822.       {
  4823.          _loc6_.push(hp[_loc3_]);
  4824.       }
  4825.       _loc3_ = _loc3_ + 1;
  4826.       if(_loc3_ >= hp.length)
  4827.       {
  4828.          _loc3_ = 0;
  4829.       }
  4830.       _loc4_ = _loc4_ + 1;
  4831.    }
  4832.    return _loc6_;
  4833. };
  4834. TheHand.prototype.gpoFix = function(c, ar)
  4835. {
  4836.    var _loc5_ = undefined;
  4837.    var _loc1_ = c;
  4838.    var _loc2_ = true;
  4839.    while(ar[_loc1_] == "e" || ar[_loc1_] == "f" || _loc2_ == true)
  4840.    {
  4841.       _loc2_ = false;
  4842.       _loc1_ = _loc1_ + 1;
  4843.       if(_loc1_ == 5)
  4844.       {
  4845.          _loc1_ = 0;
  4846.       }
  4847.    }
  4848.    return _loc1_;
  4849. };
  4850. TheHand.prototype.getRank = function()
  4851. {
  4852.    this.aR = new Array();
  4853.    var _loc2_ = 0;
  4854.    while(_loc2_ < 5)
  4855.    {
  4856.       if(_loc2_ != 2)
  4857.       {
  4858.          if(table["chipBox" + _loc2_].mybalance > 0 && table["chipBox" + _loc2_].mybalance != undefined)
  4859.          {
  4860.             this.aR.push({amt:table["chipBox" + _loc2_].mybalance,n:table["pBox" + _loc2_].myname.text,place:"0"});
  4861.          }
  4862.          else if(table["pBox" + _loc2_].myname.text != "")
  4863.          {
  4864.             this.aR.push({amt:0,n:table["pBox" + _loc2_].myname.text,place:table["pBox" + _loc2_].rank});
  4865.          }
  4866.       }
  4867.       _loc2_ = _loc2_ + 1;
  4868.    }
  4869.    this.aR.sortOn("place",18);
  4870.    this.aR.sortOn("amt",18);
  4871.    return this.aR;
  4872. };
  4873. TheHand.prototype.getStandings = function(action)
  4874. {
  4875.    arena.attachMovie("standings","standings",this.mydepth++);
  4876.    if(action == "win")
  4877.    {
  4878.       arena.standings.gotoAndStop(2);
  4879.    }
  4880.    else if(action == "lose")
  4881.    {
  4882.       arena.standings.gotoAndStop(3);
  4883.    }
  4884.    else if(action == "expired")
  4885.    {
  4886.       arena.standings.gotoAndStop(4);
  4887.    }
  4888.    else if(action == "maxed")
  4889.    {
  4890.       arena.standings.gotoAndStop(5);
  4891.       arena.standing.msg1.text = "This web version has a " + maxHandsAllowed + " hand limit per Round";
  4892.       arena.standing.msg2.text = "This web version has a " + maxHandsAllowed + " hand limit per Round";
  4893.       arena.standing.msg3.text = "This web version has a " + maxHandsAllowed + " hand limit per Round";
  4894.    }
  4895.    if(action == "win" || action == "lose" || action == "expired" || action == "maxed")
  4896.    {
  4897.       finalscore = table.chipBox3.mybalance;
  4898.       if(finalscore == undefined)
  4899.       {
  4900.          finalscore = 0;
  4901.       }
  4902.       totalTimePlayed = Math.floor((getTimer() - ntrecord) / 1000) * 0.01;
  4903.       if(totalTimePlayed < 0.5)
  4904.       {
  4905.          totalTimePlayed = 0.5;
  4906.       }
  4907.       trace("ttp = " + totalTimePlayed);
  4908.       trace("nhrec = " + nhrecord);
  4909.       trace("finalscore  = " + finalscore);
  4910.       powerranking = Math.floor(finalscore / nhrecord / totalTimePlayed);
  4911.       arena.standings.powerranking = powerranking;
  4912.       mygame.mybubble.killBubble();
  4913.       arena.standings.btn_okay._visible = false;
  4914.       arena.standings.btn_playagain._visible = true;
  4915.       arena.standings.btn_download._visible = true;
  4916.       PlayMusic("MUSIC_INTRO",_root.volM);
  4917.       arena.standings.btn_playagain.btn.onRelease = function()
  4918.       {
  4919.          _root.killTheGame("new");
  4920.          arena.standings.removeMovieClip();
  4921.       };
  4922.       arena.standings.btn_mainmenu.btn.onRelease = function()
  4923.       {
  4924.          _root.killTheGame();
  4925.          arena.standings.removeMovieClip();
  4926.       };
  4927.       arena.standings.btn_download.btn.onRelease = function()
  4928.       {
  4929.          trace("download pressed");
  4930.          _root.downloadAction();
  4931.       };
  4932.       if(_global.noZoneAPI != true)
  4933.       {
  4934.          _root.DoGameEnd();
  4935.       }
  4936.       if(_global.realmode == true)
  4937.       {
  4938.          arena.standings.btn_download._visible = false;
  4939.          arena.standings.btn_mainmenu._x += 60;
  4940.          arena.standings.btn_playagain._x += 60;
  4941.       }
  4942.    }
  4943.    else
  4944.    {
  4945.       arena.standings.btn_okay._visible = true;
  4946.       arena.standings.btn_playagain._visible = false;
  4947.       arena.standings.btn_mainmenu._visible = false;
  4948.       arena.standings.btn_download._visible = false;
  4949.       arena.standings.btn_okay.btn.onRelease = function()
  4950.       {
  4951.          arena.standings.removeMovieClip();
  4952.       };
  4953.    }
  4954.    arena.standings.btn_okay.btn.onPress = function()
  4955.    {
  4956.       _root.buttonSound();
  4957.    };
  4958.    myrank = this.getRank();
  4959.    var _loc4_ = 0;
  4960.    while(_loc4_ < myrank.length)
  4961.    {
  4962.       arena.standings["p" + _loc4_].text = myrank[_loc4_].n;
  4963.       if(myrank[_loc4_].amt > 0)
  4964.       {
  4965.          arena.standings["score" + _loc4_].text = balanceFormat(myrank[_loc4_].amt,0,",");
  4966.       }
  4967.       else
  4968.       {
  4969.          arena.standings["score" + _loc4_].text = myrank[_loc4_].place;
  4970.       }
  4971.       trace(arena.standings["p" + _loc4_].text);
  4972.       if(arena.standings["p" + _loc4_].text == undefined || arena.standings["p" + _loc4_].text == "undefined")
  4973.       {
  4974.          arena.standings["p" + _loc4_].text = " ";
  4975.          arena.standings["score" + _loc4_].text = " ";
  4976.       }
  4977.       _loc4_ = _loc4_ + 1;
  4978.    }
  4979.    var _loc5_ = 4;
  4980.    _loc4_ = mygame.elimPlayers.length - 1;
  4981.    while(_loc4_ > -1)
  4982.    {
  4983.       arena.standings["p" + _loc5_].text = mygame.elimPlayers[_loc4_].name;
  4984.       arena.standings["score" + _loc5_].text = mygame.elimPlayers[_loc4_].place;
  4985.       _loc5_ = _loc5_ - 1;
  4986.       _loc4_ = _loc4_ - 1;
  4987.    }
  4988. };
  4989. killHand = function(who)
  4990. {
  4991.    arena.potBox.removeMovieClip();
  4992. };
  4993. initLoader();
  4994. myr = 0;
  4995. stop();
  4996.